I use the CreateTableOne function to create a table for descriptive statistics - as an example, I used the mtcars dataset (and modified two variables to a factor to simulate categorical variables).
library(tableone) mydata <- mtcars mydata$gear <- as.factor(mydata$gear) mydata$carb <- as.factor(mydata$carb) VarsForTableOne <- c("mpg", "cyl", "disp", "hp", "drat", "wt", "gear", "carb") myTableOne <- CreateTableOne(vars = VarsForTableOne, data = mydata, strata = "vs") summary(myTableOne) myTableOne$ContTable myTableOne$CatTable
Now I would like to get a table for the data with continuous aspects (min, mean, median, max, quartiles) and categorical data (percentage) with each characteristic per variable.
summary(myTableOne) generates all the information which is interesting for me, but myTableOne$ContTable and myTableOne$CatTable not enough. Is there a way to customize the output of CreateTableOne?
In the end, I would like to get a table that can be formatted as HTML in a Markdown and/or copied to Excel.
Thanks for any help!
code from exploratory testing tools.
Over the weekend, Atlassian ran a New York Times ad calling on business leaders to join us in committing to a net zero future through the Science-Based Targets Initiative. As part of our gl...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event