# init dataset
library(sjmisc)
data(efc)
# plot efc-data frame summary
sjt.df(efc, alternateRowColors = TRUE)
# plot content, first 50 rows of first 5 columns of example data set
sjt.df(efc[1:50, 1:5],
describe = FALSE,
stringVariable = "Observation")
# plot efc-data frame summary, sorted descending by mean-column
sjt.df(efc,
orderColumn = "mean",
orderAscending = FALSE)
# plot first 20 rows of first 5 columns of example data set,
# sort by column "e42dep" with alternating row colors
sjt.df(efc[1:20, 1:5],
alternateRowColors = TRUE,
orderColumn = "e42dep",
describe = FALSE)
# plot first 20 rows of first 5 columns of example data set,
# sorted by 4th column in descending order.
sjt.df(efc[1:20, 1:5],
orderColumn = 4,
orderAscending = FALSE,
describe = FALSE)
# add big mark to thousands
library(datasets)
sjt.df(as.data.frame(WorldPhones), big.mark = ",")
# ----------------------------------------------------------------
# User defined style sheet
# ----------------------------------------------------------------
sjt.df(efc,
alternateRowColor = TRUE,
CSS = list(css.table = "border: 2px solid #999999;",
css.tdata = "border-top: 1px solid;",
css.arc = "color:blue;"))
Run the code above in your browser using DataLab