New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings (soon errors) with complex attributes in gather_attrs #196

Closed
rubenarslan opened this Issue Jan 8, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@rubenarslan

rubenarslan commented Jan 8, 2019

  • a possible bug

I'm importing a dataset with Qualtrics-related metadata that someone sent me. The attributes are a bit dirty, so I use gather_attrs to clean them up. I think this used to work fine, but it throws two warnings:

Warning messages:
1: In if (grepl("labelled", class(x[[i]]))) { :
the condition has length > 1 and only the first element will be used
2: Unknown or uninitialised column: 'foreign'.

I think the first warning now leads to an error on winbuilder because of R_CHECK_LENGTH_1_LOGIC2. You fixed it already for standardize_attrs.

## load package
library("rio")
x <- structure(list(Q11 = structure(c(4L, 1L), class = c("ordered", 
                                                         "factor"), .Label = c("Extremely useful", "Very useful", "Moderately useful", 
                                                                               "Slightly useful", "Not useful at all"), label = c(Q11 = "How useful are the services provided at the on-campus career center?"))), row.names = c(NA, 
                                                                                                                                                                                                                                 -2L), class = c("tbl_df", "tbl", "data.frame"))

gather_attrs(x)

session info for your system

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rio_0.5.16     dplyr_0.7.8    codebook_0.7.6

@leeper leeper added the bug label Jan 11, 2019

@leeper

This comment has been minimized.

Owner

leeper commented Jan 11, 2019

Thanks!

@leeper leeper closed this in 32662b6 Jan 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment