Description Usage Arguments Value Examples
This enables you to inspect labels at the variable or value label.
If requesting value labels for a var
, the default is to also
tabulate the frequencies and percents. Can provide an optional column
of weights to calculated weighted frequencies and percentages.
1 | label_table(data, var, freq = TRUE, weight)
|
data |
A data frame where variable or value labels are requested. |
var |
If value labels are requested, provide corresponding column (unquoted) in the data frame. |
freq |
Logical, whether or not to tabulate frequencies for the value labels. |
weight |
An unquoted column of weights. |
A data frame of variable or value labels.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(dplyr)
library(labelled)
library(iterake)
df <-
data.frame(
x = sample(c(1, 2), 100, replace = TRUE),
w = rnorm(100, 1, 0.1)
) %>%
set_variable_labels(
x = "Gender",
w = "Weight"
) %>%
set_value_labels(
x = c("Male" = 1, "Female" = 2)
)
label_table(df)
label_table(df, x, freq = FALSE)
label_table(df, x)
label_table(df, x, weight = w)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.