# \donttest{
library(metan)
df_ge <- ge_simula(ngen = 2,
nenv = 3,
nrep = 2) %>%
add_cols(ENV = c(rep("CACIQUE", 4),
rep("FREDERICO", 4),
rep("SANTA_MARIA", 4)))
df_ge
# Add sequential block numbering over environments
add_seq_block(df_ge, ENV, REP, prefix = "B")
# Recode the 'ENV' column to "ENV1", "ENV2", and so on.
recode_factor(df_ge,
factor = ENV,
prefix = "ENV",
new_factor = ENV_CODE)
# Format the data to be used in the Selegen software (model 54)
df <- df_to_selegen_54(df_ge, ENV, GEN, REP) %>%
recode_factor(ENV, prefix = "E", new_factor = ENV)
# }
Run the code above in your browser using DataLab