0

Here is my code:

library("tidyverse")
library("readxl")
library("dplyr")
COVID_survey_data <- read_excel("C:\\Users\\hreutter\\Desktop\\IDA_Survey_data\\IDA_CovidSurvey.xlsx", sheet = "IDA_CovidSurvey_2020-05-08")
revdata <- select(COVID_survey_data, final_qnum, q045:q047, q054, q057:q059, q063:q065, q110:q111)
REVdata <- data.frame(lapply(revdata, FUN = function(foo) recode(foo, '1=5; 2=4; 3=3; 4=2; 5=1')))

The last line is yielding the error for me but not for my co-worker. Any ideas why I'm getting the error or how to fix it?

I'm very new to R, so please write any help on the assumption that I know absolutely nothing. Thank you!

hreutter
  • 1
  • 1
  • 1
    please check your version of dplyr with the version of your coworker. As the example is not reproducible, it is difficult to know the issue – akrun May 19 '20 at 18:24
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. It's best not to use file paths that only exist on your computer in your question. Perhaps you are getting different results because you are using different version of `dplyr`. But it looks really suspicious that your values are wrapped in a string. It almost looks like you are using the `recode()` syntax from a different package. – MrFlick May 19 '20 at 18:27
  • Thank you for your responses, I'll try to discuss with my co worker. I'm not sure what's needed for other to know about the data. It's survey data on a likert scale that I want to reverse score. – hreutter May 19 '20 at 20:27

1 Answers1

0

There are probably multiple recode functions in the packages you currently use in your workspace. Try to define which recode function you are using like this dplyr::recode

Nermin
  • 1