Learn R Programming

sjPlot (version 2.0.0)

view_df: View structure of labelled data frames

Description

Save (or show) content of an imported SPSS, SAS or Stata data file, or any similar labelled data.frame, as HTML table. Similar to the SPSS variable view. This quick overview shows variable ID numner, name, label, type and associated value labels. The result can be considered as "codeplan" of the data frame.

Usage

view_df(x, weight.by = NULL, altr.row.col = TRUE, show.id = TRUE,
  show.type = FALSE, show.values = TRUE, show.labels = TRUE,
  show.frq = FALSE, show.prc = FALSE, show.wtd.frq = FALSE,
  show.wtd.prc = FALSE, show.na = FALSE, sort.by.name = FALSE,
  wrap.labels = 50, hide.progress = FALSE, CSS = NULL, encoding = NULL,
  file = NULL, use.viewer = TRUE, no.output = FALSE,
  remove.spaces = TRUE)

Arguments

Value

Invisibly returns
  • the web page style sheet (page.style),
  • the web page content (page.content),
  • the complete html-output (output.complete) and
  • the html-table with inline-css for use with knitr (knitr)
for further use.

Details

See 'Details' in sjt.frq.

See Also

  • http://www.strengejacke.de/sjPlot/datainit/{sjPlot manual: data initialization}
  • http://www.strengejacke.de/sjPlot/view_spss/{sjPlot manual: inspecting (SPSS imported) data frames}

Examples

Run this code
# init dataset
library(sjmisc)
data(efc)

# view variables
view_df(efc)

# view variables w/o values and value labels
view_df(efc, show.values = FALSE, show.labels = FALSE)

# view variables including variable typed, orderd by name
view_df(efc, sort.by.name = TRUE, show.type = TRUE)

# ---------------------------------------------------------------- 
# User defined style sheet
# ---------------------------------------------------------------- 
view_df(efc,
        CSS = list(css.table = "border: 2px solid;",
                   css.tdata = "border: 1px solid;",
                   css.arc = "color:blue;"))

Run the code above in your browser using DataLab