-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorreprexneeds a minimal reproducible exampleneeds a minimal reproducible example
Description
I have a package that stores a number of survey datasets with recoded data in them. The script below installs the package and tries to construct a tabular dataset from the various datasets. It was working for me up until recently. However, now it returns an error
Error in bind_rows(): ! Can't combine ..1$male<haven_labelled> and..2$male<haven_labelled>. ✖ Some attributes are incompatible. ℹ The author of the class should implement vctrs methods.
This is a stripped down version of the code and it reproduces the error.
It was working for me earlier.
library(tidyverse)
remotes::install_github("sjkiss/cesdata2")
#> Using GitHub PAT from the git credential store.
#> Skipping install of 'cesdata2' from a github remote, the SHA1 (4bf65d7e) has not changed since last install.
#> Use `force = TRUE` to force installationlibrary(cesdata2)
# List data frames
ces.list<-list(ces84, ces88, ces93, ces97, ces00, ces15phone, ces15web, ces19phone, ces19web, ces21)
#Provide names for list
names(ces.list)<-c( 1984, 1988, 1993, 1997, 2000, "2015 Phone", "2015 Web","2019 Phone", "2019 Web", 2021)
#Common variables to be selected
common_vars<-c('male',
'sector',
'occupation', 'vote')
ces.list %>%
map(., select, any_of(common_vars))%>%
#bind_rows smushes all the data frames together, and creates a variable called election
bind_rows()->ces
#> Error in `bind_rows()`:
#> ! Can't combine `..1$male` <haven_labelled> and `..2$male` <haven_labelled>.
#> ✖ Some attributes are incompatible.
#> ℹ The author of the class should implement vctrs methods.
#> ℹ See <https://vctrs.r-lib.org/reference/faq-error-incompatible-attributes.html>.Created on 2024-06-19 with reprex v2.1.0
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorreprexneeds a minimal reproducible exampleneeds a minimal reproducible example