make.X {BayesGWQS} | R Documentation |
This function returns a matrix of component variables, X. The user can specify the desired chemicals and order by creating a list of string vectors, each vector containing the variable names of all desired elements of that group.
make.X(df, num.groups, groups)
df |
A dataframe containing named component variables |
num.groups |
An integer representing the number of component groups desired |
groups |
A list, each item in the list being a string vector of variable names for one component group |
A matrix of component variables
data("simdata")
group_list <- list(c("pcb_118", "pcb_138", "pcb_153", "pcb_180", "pcb_192"),
c("as", "cu", "pb", "sn"),
c("carbaryl", "propoxur", "methoxychlor", "diazinon", "chlorpyrifos"))
X <- make.X(simdata, 3, group_list)
X