view_df {sjPlot} | R Documentation |
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.
This quick overview shows variable ID number, 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,
alternate.rows = TRUE,
show.id = TRUE,
show.type = FALSE,
show.values = TRUE,
show.string.values = FALSE,
show.labels = TRUE,
show.frq = FALSE,
show.prc = FALSE,
show.wtd.frq = FALSE,
show.wtd.prc = FALSE,
show.na = FALSE,
max.len = 15,
sort.by.name = FALSE,
wrap.labels = 50,
verbose = FALSE,
CSS = NULL,
encoding = NULL,
file = NULL,
use.viewer = TRUE,
remove.spaces = TRUE
)
Arguments
x |
A (labelled) data frame, imported by |
weight.by |
Name of variable in |
alternate.rows |
Logical, if |
show.id |
Logical, if |
show.type |
Logical, if |
show.values |
Logical, if |
show.string.values |
Logical, if |
show.labels |
Logical, if |
show.frq |
Logical, if |
show.prc |
Logical, if |
show.wtd.frq |
Logical, if |
show.wtd.prc |
Logical, if |
show.na |
logical, if |
max.len |
Numeric, indicates how many values and value labels per variable are shown. Useful for variables with many different values, where the output can be truncated. |
sort.by.name |
Logical, if |
wrap.labels |
Numeric, determines how many chars of the value, variable or axis labels are displayed in one line and when a line break is inserted. |
verbose |
Logical, if |
CSS |
A |
encoding |
Character vector, indicating the charset encoding used
for variable and value labels. Default is |
file |
Destination file, if the output should be saved as file.
If |
use.viewer |
Logical, if |
remove.spaces |
Logical, if |
Value
Invisibly returns
the web page style sheet (
page.style
),the web page content (
page.content
),the complete html-output (
page.complete
) andthe html-table with inline-css for use with knitr (
knitr
)
for further use.
Examples
## Not run:
# init dataset
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;"))
## End(Not run)