Closed DanielEWeeks closed 1 year ago
Hi @DanielEWeeks, thanks for the detailed bug report!
The haven_labelled and haven_labelled_spss classes are implemented using the vctrs package, which provides the subsetting functions and is the source of this error message. Any change will need to be made in vctrs, and this issue will also affect any other packages that use vctrs to implement their classes.
I've created an issue over at r-lib/vctrs#1751 - I'm closing this issue since there's nothing additional we can do on the haven side.
haven_labelled
vectors should ignore commonly useddrop
argument instead of erroring out.For details, see https://support.bioconductor.org/p/9148139/ where in part the discussion states:
Brief description of the problem
A
haven_labelled
double
vectorx
generates a cryptic errorError in proxy[, ..., drop = FALSE] : incorrect number of dimensions
when usingx[i, drop=TRUE]
orx[i, drop=FALSE]
, while such operations work just fine ondouble
objects. This also occurs withhaven_labelled
character
vectors as well as withhaven_labelled
integer
vectors.Looks like
haven_labelled
vectors are sent to the[.vctrs_vctr
operator with thedrop = TRUE
, which doesn't like thedrop = TRUE
argument:Minimal reproducible example
Output from the Minimal reproducible example