Labelled Data Utility Functions

Collection of functions dealing with labelled data, like reading and writing data between R and other statistical software packages like 'SPSS', 'SAS' or 'Stata', and working with labelled data. This includes easy ways to get, set or change value and variable label attributes, to convert labelled vectors into factors or numeric (and vice versa), or to deal with multiple declared missing values.


This package contains utility functions that are useful when working with labelled data (especially intended for people coming from 'SPSS', 'SAS' or 'Stata' and/or who are new to R).

Basically, this package covers reading and writing data between other statistical packages (like 'SPSS') and R, based on the haven and foreign packages; hence, this package also includes functions to make working with labelled data easier. This includes easy ways to get, set or change value and variable label attributes, to convert labelled vectors into factors or numeric (and vice versa), or to deal with multiple declared missing values.

Installation

Latest development build

To install the latest development snapshot (see latest changes below), type following commands into the R console:

library(devtools)
devtools::install_github("strengejacke/sjlabelled")

Officiale, stable release

CRAN_Status_Badge    downloads    total

To install the latest stable release from CRAN, type following command into the R console:

install.packages("sjlabelled")

Citation

In case you want / have to cite my package, please use citation('sjlabelled') for citation information.

News

sjlabelled 1.0.7

General

  • Cross references from dplyr::select_helpers were updated to tidyselect::select_helpers.
  • Replace deprecated arguments in convert_case() from call to package snakecase

sjlabelled 1.0.6

Changes to functions

  • get_dv_labels() and get_term_labels() now support clm-objects from package ordinal, polr-objects from package MASS and Zelig-relogit-objects from package Zelig.
  • get_dv_labels() and get_term_labels() get a ...-argument to pass down further arguments to snakecase::to_any_case().
  • convert_case() is now exported, for usage in other packages as well.
  • Remove protect-argument from internal case conversion (affects get_term_labels() and get_dv_labels()), in preparation for forthcoming snakecase-package update.

sjlabelled 1.0.5

General

  • Remove unnecessary imports.
  • Revised lbl_df() due to changes in the internals of tibble::trunc_mat().

New functions

  • as_factor() to convert labelled vectors into factors, preserving labels.

Changes to functions

  • get_dv_labels() now supports brmsfit-objects from package brms.

sjlabelled 1.0.4

Changes to functions

  • get_term_labels() now includes variable names for factors with numeric factor levels only (and not only return the numeric level as term label).

Bug fixes

  • Fixed bug for as_label(), when x was a character vector and argument drop.levels was TRUE.
  • Fixed issue for lme and gls objects in get_term_labels() and get_dv_labels().

sjlabelled 1.0.3

General

  • Changed package imports, so sjlabelled no longer requires R version 3.3.3 or higher.

sjlabelled 1.0.2

General

  • Minor fix to avoid warning when using as_numeric().

Changes to functions

  • get_label(), get_term_labels() and get_dv_labels() get a case-argument, to convert labels into any case, using the snakecase-package.

sjlabelled 1.0.1

General

  • Removed function 'var_rename()', which is in pkg 'sjmisc'.

New functions

  • get_term_labels() and get_dv_labels() to retrieve term labels from regression models.

Changes to functions

  • as_numeric() gets a use.labels-argument to use value labels as new values if these are numeric.

sjlabelled 1.0.0

General

  • Initial release. All labelled data utility functions from package sjmisc have been moved to this package, which is now dedicated to tools for working with labelled data.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sjlabelled")

1.0.11 by Daniel Lüdecke, 19 days ago


https://github.com/strengejacke/sjlabelled


Report a bug at https://github.com/strengejacke/sjlabelled/issues


Browse source code at https://github.com/cran/sjlabelled


Authors: Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>)


Documentation:   PDF Manual  


GPL-3 license


Imports broom, dplyr, haven, magrittr, prediction, purrr, rlang, snakecase, tibble, tidyselect, utils

Depends on stats

Suggests ggplot2, glmmTMB, Hmisc, sjmisc, sjPlot, survey, knitr, rmarkdown, Zelig


Imported by ggeffects, qualtRics, sjPlot, sjmisc, sjstats.

Suggested by miceadds.


See at CRAN