Dear Tiago,
Sorry to say that I don't know how to prepare "reprex". But I will be precise.
PROBLEM :-
Same code of "metan" to get MGIDI is running on one dataset (df.xlsx, attached) , but not on similar second dataset (df2.xlsx, attached).
The code I used is pasted here. It generates following message after line "$$$" in code is run. :::
"Error in cor(means, use = use) : no complete element pairs
In addition: Warning message:
Missing values observed in the table of means. Using complete observations to compute the correlation matrix. "
CODE :-
getwd()
setwd("C:/Users/hp/Desktop/MGIDI")
library(metan)
library(tidyverse)
library(tidyr)
library(dplyr)
library(rio)
df <- import("df2.xlsx", sheet=1)
str(df)
df <- df %>% mutate(across(where(is_character),as_factor))
str(df)
mod <-
gamem(df,
gen = GEN,
rep = REP,
resp = c('T1', 'T2','T3','T4','T5','T6','T7'),
verbose = F)
print(mod)
gmd(mod, "blupg")
$$$ mgidi_ind <- mgidi(mod, mineval=1,SI=33,ideotype = c("h, h, h, h, h, h, h"))
gmd(mgidi_ind, "MGIDI")
p1 <- plot(mgidi_ind, type = "contribution" )
p2 <- plot(mgidi_ind, SI=33,type = "index", title = "MGIDI for Control")
p2 + p1
DATA FILES ATTACHED::-
df.xlsx
df2.xlsx
Hope you will consider my limitation and help.
Regards.