allogamous / EnvRtype

Provide tools for collecting environmental data from GIS-based platforms,enabling environmental characterization studies, providing environmental relatedness kinships and kernels for genomic prediction of reaction norms
24 stars 17 forks source link

Creating kernel models with get_kernel doesn't work #12

Closed PaulPOOFA closed 2 years ago

PaulPOOFA commented 2 years ago

Thanks for creating the package.

I am facing difficulty creating kernel models EMM, EMDs, RMMM and RNMDs based on the toy data set in the package. I am receiving error message: length of 'dimnames' [1] not equal to array extent. I do not know how to fix this.

EMM = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "EMM") EMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "EMDs") RMMM = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "RNMM") RNMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "RNMDs")

Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent

Thanks.

huw143 commented 8 months ago

Any solution for this, I met the same issue here.

Thanks for your helps,

Tiger

PaulPOOFA commented 8 months ago

Hello,

The question has been closed. Can you send it the problem here?

Thanks.

On Thu, Nov 2, 2023 at 8:19 PM huw143 @.***> wrote:

Any solution for this, I met the same issue here.

Thanks for your helps,

Tiger

— Reply to this email directly, view it on GitHub https://github.com/allogamous/EnvRtype/issues/12#issuecomment-1791733184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWTB5ZSFMOBHCJWLXS7JYK3YCQZ77AVCNFSM5IOWQYZKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZZGE3TGMZRHA2A . You are receiving this because you authored the thread.Message ID: @.***>

huw143 commented 8 months ago

Thank you Paul for your quick response,

The question is same:

EMM = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "EMM") EMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "EMDs") RMMM = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "RNMM") RNMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "RNMDs")

Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent

But I figured it out already,

This is because the gid in the dataframe of maizeYield are not the same format, some of them are character, while some of them are not. I used the following R script to fix it.

maizeYield$gid <- as.character(maizeYield$gid)

Thanks for your contribution to this R package, which is amazing!

Best regards,

Tiger

PaulPOOFA commented 8 months ago

I am glad you figured it out. Thanks.

On Thu, Nov 2, 2023 at 9:56 PM huw143 @.***> wrote:

Thank you Paul for your quick response,

The question is same:

EMM = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "EMM") EMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "EMDs") RMMM = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "RNMM") RNMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env, data = maizeYield, model = "RNMDs")

Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent

But I figured it out already,

This is because the gid in the dataframe of maizeYield are not the same format, some of them are character, while some of them are not. I used the following R script to fix it.

maizeYield$gid <- as.character(maizeYield$gid)

Thanks for your contribution to this R package, which is amazing!

Best regards,

Tiger

— Reply to this email directly, view it on GitHub https://github.com/allogamous/EnvRtype/issues/12#issuecomment-1791801755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWTB5ZXK77T6TUKVKFYCX2DYCRFK7AVCNFSM5IOWQYZKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZZGE4DAMJXGU2Q . You are receiving this because you authored the thread.Message ID: @.***>