comp | R Documentation |
Aim : To describe numeric variables or categorical variables (need to be in factor) according to an another variable
comp(vars, comp.var, labels, data)
vars |
list of vars you want to describe |
comp.var |
variable to compare (need to be data$var) |
labels |
labels for the list of vars |
data |
name of the dataset |
the result
data <- data.frame(Id = 1:4 ,
Vaccs = c("pfizer,moderna"," ", "pfizer", "moderna"),
Cov = 1,0,1,0)
vars <- c("Id", "Vaccs")
labels <- c("Id number", "Vaccination Brand")
## Not run:
tab.comp1 <- comp(vars,data$Cov , labels, data)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.