NickCH-K / vtable

An R package for creating Variable Documentation Files

Home Page:https://nickch-k.github.io/vtable/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error message with values=TRUE

atreyagagan opened this issue · comments

I get an error when I call the vtable function for my dataset with this command:

vtable(ds)
The error message says:

Error in sjlabelled::get_labels(data, values = TRUE) : 
  unused argument (values = TRUE)

RStudio on Microsoft R Open. Ubuntu 18.04 LTS

Any help would be appreciated. Thank you!

Hmm, I can't get that error to pop up. Try updating the sjlabelled package; if you still get the same error can you post a reproducible example (or if possible, share the data you're getting the error with)?

So, this only happens with certain datasets, but not others.

For this example, I used this dataset available at the "Data For Progress" website.

Step 1. Download the dataset above.

Step 2. Do this in R;

## Import libraries:

library(data.table)
library(vtable)

## Import the dataset (this depends on where the csv is located in your computer):
ds <- fread("~/Desktop/DFP_WTHH_release.csv")

vtable(ds)

I get this error message:

Error in sjlabelled::get_labels(data, values = TRUE) : 
  unused argument (values = TRUE)

I tried this after removing and reinstalling the sjlabelled package, but I still get the same error.
I've had this happen with a couple of other datasets as well (while other datasets work fine).
Also, I get the same error when I use read_csv through the tidyverse instead of fread.

Using RStudio and Microsoft R Open on Ubuntu 18.04 LTS.

Thanks!

Hmm, weird. I've run your code just now with that data set on both my Windows machine and Rstudio.cloud (which runs Ubuntu) and it works fine; tried it with read_csv as well instead of fread and that worked fine too. It also works without error if I just run sjlabelled::get_labels(ds, values = TRUE) directly.

I suppose it's possible that it's a Microsoft R Open issue but that would be super weird. Like, why would that make a difference? Can you try:

  1. if your vtable version is not 0.5.0 (check with sessionInfo() after loading vtable), update vtable and try again
  2. Running sjlabelled::get_labels(ds, values = TRUE) directly

If 2 produces an error, then it's probably something weird with the way sjlabelled::get_labels() works in Microsoft R Open. Not sure what I can do about that other than reducing dependency on sjlabelled somehow. If 2 doesn't produce an error, then I'm stumped.

It was missing dependencies in MRO. I removed sjlabelled, and installed the latest version from devtools, and also installed the "insight" package via devtools. Now vtable works fine for me. Thank you for your help. This might be useful for users on MRO.

Phew! Thanks for checking in to this.