# NOT RUN {
# }
# NOT RUN {
data(eco.test)
# mlm additive model
mod <- eco.lmtree(df1 = eco3[["P"]], df2 = eco3[["E"]],
analysis = "mlm")
mod
summary(mod)
# mctree additive model
mod <- eco.lmtree(df1 = eco3[["P"]], df2 = eco3[["E"]],
analysis = "mctree", fact = eco3[["S"]]$pop)
#-----------------------
# ACCESSORS USE EXAMPLE
#-----------------------
# the slots are accessed with the generic format
# (ecoslot. + name of the slot + name of the object).
# See help("EcoGenetics accessors")
summary(mod)
ecoslot.FREQUENCIES(mod) # slot FREQUENCIES
# frequency table with counts of individuals in populations x terminal nodes
tabfreq <- do.call(cbind, ecoslot.FREQUENCIES(mod))
namestab <- lapply(ecoslot.FREQUENCIES(mod), ncol)
namestab <- lapply(namestab, rep)
namestab <- rep(names(namestab), namestab)
colnames(tabfreq) <- namestab
tabfreq
# mlm custom model
mymod <- "E1+E2*E3"
mod <- eco.lmtree(df1 = eco[["P"]], df2 = eco[["E"]],
analysis = "mlm", mod.class = mymod)
summary(mod)
# mctree custom model
mod <- eco.lmtree(df1 = eco[["P"]], df2 = eco[["E"]],
analysis = "mctree", mod.class = mymod, fact = eco[["S"]]$pop)
summary(mod)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab