Hi: I have a package that stores a lot of data frames with labelled variables. The code below shows how I combine those data frames into a tabular dataset for analysis. But, somehow it has started failing with the error below. Can anyone clarify what is going on? This is reproducible code.s
``` r
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 installation
library(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