Description Usage Arguments Details Examples
View source: R/Table1_functions.R
A function to create a summary of missing data for 1 or more groups.
1 | missing_table(data, variables, group, col.names = T)
|
data |
a data frame containing the variables listed in variables and the group variable. |
variables |
a vector or scalar of variables of interest, in quotation marks. |
group |
an R object. Grouping variable can have >=1 level(s). |
col.names |
a logical value indicating whether the column labels with group name and sample size are desired. |
Can handle >=1 group; number of columns will adjust automatically.
1 2 3 4 5 6 7 8 9 10 11 | iris$sepal_di<-as.factor((iris$Sepal.Length<5)*1)
#set factor levels
levels(iris$sepal_di)=c("<5",'>=5')
levels(iris$Species)=c('Setosa','Versicolor','Virginica')
#Set Labels
label(iris$sepal_di)='Sepal Length'
label(iris$Sepal.Length)="Sepal Length"
label(iris$Sepal.Width)='Sepal Width'
label(iris$Petal.Length)='Petal Length'
label(iris$Petal.Width)='Petal Width'
tab_miss<-missing_table(iris,c('Sepal.Length','Petal.Length','Sepal.Width','Petal.Width','sepal_di'),iris$Species)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.