nature.variables | R Documentation |
Splits a data matrix according to the detected nature of variables. Columns of class integer are considered quantitative (num). Character of factor are consider qualitative (nom). Warning, ordinal variables can not be detected by this function, and must be manually indicated by the user.
nature.variables(data, print.nature = TRUE)
data |
a data frame with n rows (individuals) and p columns (numeric, nominal and/or ordinal variables) |
print.nature |
boolean (default = TRUE), if TRUE results are printed. |
data.numeric : data.frame with numeric variables
p.numeric : columns index of numeric variables
nb.numeric : number of numeric variables
data.quali : data.frame with numeric variables
p.quali : columns index of numeric variables
nb.quali : number of numeric variables
data (antibiotic) res.mix <- PCA.OS::nature.variables(antibiotic) res.mix$p.numeric head(res.mix$data.numeric) res.mix$p.quali head(res.mix$data.quali) nature <- rep(NA,ncol(antibiotic)) #Setting nature argument for PCAOS function nature[res.mix$p.numeric] <- "num" nature[res.mix$p.quali] <- "nom" nature[2] <- "ord"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.