Codes for cross tables.^[See childRmd/_12crossTables.Rmd
file for other codes]
library(finalfit)
dependent <- c("dependent1", "dependent2" ) explanatory <- c("explanatory1", "explanatory2" )
source(here::here("R", "gc_table_cross.R"))
CreateTableOne(vars = myVars, strata = "columnname", data = pbc, factorVars = catVars)
print(tab, nonnormal = biomarkers, exact = "exactVariable", smd = TRUE)
write2html( knitr::kable(head(mockstudy)), paste0(tmpdir, "/test.kable.keep.rmd.html"), quiet = TRUE, # passed to rmarkdown::render keep.rmd = TRUE )
ctable(tobacco$gender, tobacco$smoker, style = 'rmarkdown')
print(ctable(tobacco$gender, tobacco$smoker), method = 'render') print(ctable(tobacco$smoker, tobacco$diseased, prop = "r"), method = "render") with(tobacco, print(ctable(smoker, diseased, prop = 'n', totals = FALSE, chisq = TRUE), headings = FALSE, method = "render"))
# devtools::install_github("ewenharrison/summarizer") # library(summarizer) # data(colon_s) explanatory = c("age", "age.factor", "sex.factor", "obstruct.factor") dependent = "perfor.factor" colon_s %>% summary.factorlist(dependent, explanatory, p=TRUE) %>% knitr::kable(row.names=FALSE, align=c("l", "l", "r", "r", "r")) explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor") dependent = 'mort_5yr' colon_s %>% summary.factorlist(dependent, explanatory) %>% knitr::kable(row.names=FALSE, align=c("l", "l", "r", "r", "r"))
library(DT) datatable(mtcars, rownames = FALSE, filter="top", options = list(pageLength = 5, scrollX=T) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.