Learn R Programming

sjmisc (version 1.8)

get_frq: Get summary of labelled vectors

Description

This function returns a summary, including frequency table, of labelled vectors, as data frame. Unlike summary, the frq method also prints label and missing attributes.

Usage

get_frq(x, coerce = TRUE)

Arguments

x
A labelled vector.
coerce
Logical, if TRUE, vectors will be coerced to labelled class if necessary.

Value

A data frame with the summary information of x.

Examples

Run this code
# create labelled factor, with missing flag
x <- labelled(c("M", "M", "F", "X", "N/A"),
              c(Male = "M", Female = "F",
                Refused = "X", "Not applicable" = "N/A"),
              c(FALSE, FALSE, TRUE, TRUE))

get_frq(x)

Run the code above in your browser using DataLab