Learn R Programming

sjPlot (version 1.8.1)

view_spss: View SPSS (and SAS/Stata) data set structure

Description

Save (or show) content of an imported SPSS, SAS or Stata data file 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_spss(df, file = NULL, alternateRowColors = TRUE, showID = TRUE,
  showType = FALSE, showValues = TRUE, showValueLabels = TRUE,
  showFreq = FALSE, showPerc = FALSE, sortByName = FALSE,
  breakVariableNamesAt = 50, encoding = NULL, hideProgressBar = FALSE,
  CSS = NULL, useViewer = 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_spss(efc)

# view variables w/o values and value labels
view_spss(efc, showValues = FALSE, showValueLabels = FALSE)

# view variables including variable typed, orderd by name
view_spss(efc, sortByName = TRUE, showType = TRUE)

# ----------------------------------------------------------------
# User defined style sheet
# ----------------------------------------------------------------
view_spss(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