sjlabelled | Working with Labelled Data in R | Development Tools library
kandi X-RAY | sjlabelled Summary
kandi X-RAY | sjlabelled Summary
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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sjlabelled
sjlabelled Key Features
sjlabelled Examples and Code Snippets
library(devtools)
devtools::install_github("strengejacke/sjlabelled")
install.packages("sjlabelled")
Community Discussions
Trending Discussions on sjlabelled
QUESTION
I have a list of observation labels that goes with a .csv data set, e.g., 1 = "Yes", 0 = "No", where the label for all observations equal to 1 for column k has the label of "Yes" but retains the underlying numerical value of 1 or 0.
I want to iteratively add labels to my dataset using this list, ideally using purrr or the tidyverse.
Here is an example of what I am trying to do, but at scale across multiple columns.
...ANSWER
Answered 2022-Apr-07 at 18:33One option to achieve your desired result would be to name your labels list according to the column names of your data. Doing so you could label your data using just set_labels
:
QUESTION
I have this dataframe:
...ANSWER
Answered 2022-Mar-19 at 16:44Try the assignment
QUESTION
I have a summary regression model I want to put into a table. However, it keeps coming up with an error. Not sure what I am doing wrong here. I have included a reproducible data and steps I have taken below.
...ANSWER
Answered 2022-Feb-10 at 00:41You shouldn't assign the output of tab_model()
to a variable - that prevents it from writing the HTML file. If you just run tab_model()
without assigning it to test
you'll be fine.
The following works for me:
QUESTION
I'm working with British Election Study data. To be used in R, this first has to be converted from the .dta form provided, which I think puts labels on to a lot of variables. Most of the time this is useful, but I think a problem I've got is where this isn't the case.
Using as_factor()
blindly converts all variables with labels to factors. Is there a way to specify that only certain vectors are converted ? i.e
ANSWER
Answered 2021-Oct-09 at 14:52To your first questions, you need mutate
to convert a single column, e.g.
QUESTION
Hi I am using labelled data in R with the haven and sjlabelled packages. I want to reference the variable's label when I graph it. It works if I directly reference the dataframe and the label (see get_label
function in the graph's title).
ANSWER
Answered 2021-Jul-29 at 21:39We may use ensym
here instead of {{}}
QUESTION
I need to label a values in a lot of variables with sjlabelled::set_labels. Here is a reproducable example and what already works:
...ANSWER
Answered 2021-Mar-31 at 11:17Match the column names of data
with id
, split the answers
on ;
and pass the labels as a list.
QUESTION
I need to label a lot of variables with sjlabelled::set_label. Here is a reproducable example and what already works:
...ANSWER
Answered 2021-Mar-31 at 09:18You can use set_label
directly on a dataframe.
QUESTION
Hi I have a dataframe of COVID symptoms and COVID diagnosis:
EDITED TO ADD PACKAGES
...ANSWER
Answered 2021-Feb-19 at 19:10Couldn't reproduce the error with the same data using labelled
QUESTION
Again and again I have to search the internet when it comes to label my dataframe variables. For me this is not a trivial issue when doing it in the context with dplyr.
Using the set_label function from sjlabelled package I have learned to create a label vector and pass it to the variables of the dataframe. But then something unexpected happened.
For demonstration purposes I have modified the iris dataset (changed the class of Species to character). I would like to know why the label of the variable Species disappears in case of Species as character class (case1) and remains in case of Species as factor class (case 2, commented out in the code) - after using mutate and recode.
...ANSWER
Answered 2021-Jan-02 at 21:48I think you've found a bug, or rather a lack of compatibility. dplyr::recode
seems to remove the label
attribute.
QUESTION
I want the summary output of my linear regression models neatly presented.
The HTML tables in this tutorial https://www.r-bloggers.com/2015/03/beautiful-tables-for-linear-model-summaries-rstats/ is exactly what I want.
The problem's that when I try to run the example code from the tutorial, I get an error message: Error in sjt.lm(fit1, fit2) : could not find function "sjt.lm"
Thanks for any help!
...ANSWER
Answered 2020-Oct-27 at 16:07This package has been updated since 2005. The new plot functionality is plot_model()
. See website for more info: https://strengejacke.github.io/sjPlot/index.html
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sjlabelled
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page