I'm using R 4.0.0
and Rstudio 1.2.5042
on a windows 64
machine. Version of the packages I'm using are listed next to them below.
I'm deeply wondering WHY I'm getting the following error: Error: Problem with mutate() input ..1
?
Is there anyone else getting the same error?
library(dplyr) # 1.0.0
library(haven) # 2.3.1
library(sjmisc) # 2.8.4
library(googledrive) # 1.0.1
drive_download('https://drive.google.com/file/d/124WOY4iBXxv_9eBXsoHJVUzX98x2sxYy/view?usp=sharing','test.por',overwrite=T)
dta <- read_por('test.por')
names(dta) <- tolower(names(dta))
vars_chrs <- c("childid","l5cathol","l5public","r5race","w3povrty","w3daded","w3momed","w3inccat","p5fstamp")
vars_nums <- c("w3momscr", "w3dadscr","p5numpla","p5hmage","p5hdage","c5r2mtsc")
dta %>%
mutate(across(vars_chrs, ~ as.character(to_label(.))), ## ANYONE GETTING ERROR HERE??
across(vars_nums, ~ as.numeric(as.character(to_label(.)))))