Table1 {lulab.utils} | R Documentation |
Make Table1
Table1(df, ycol, xcol, xlabels, result_dir, verbose = TRUE)
df |
a data.frame |
ycol |
a grouping variable |
xcol |
variables to be compared |
xlabels |
levels of ycol |
result_dir |
directory to save the result |
verbose |
logical, controlling the output |
This function is used to make Table1 and return excel file.
excel file
Zhen Lu
data("melanoma", package = "boot")
melanoma2 <- melanoma
# Factor the basic variables that
# we're interested in
melanoma2$status <-
factor(melanoma2$status,
levels=c(2,1,3),
labels=c("Alive", # Reference
"Melanoma death",
"Non-melanoma death"))
test= Table1(
df= melanoma2,
xcol= setdiff(names(melanoma2), "status"),
ycol= "status",
result_dir= tempdir()
)