Most of the data I practice R with is imported from my SPSS files using the haven package. I am trying to reverse code a few columns for scales that go from 1 to 9 (i.e., trying to convert all 1s into 9s, 2s into 8s, etc.) and found another forum describing the psych package. I have tried it on my data and am almost certain my code is correct (and variables properly spelt), but I keep getting an error: requires numeric/complex matrix/vector arguments. I was wondering if this is because the class for the columns in the data file is "haven-labelled" instead of being numeric.
data <- read_spss(Pilot1RAWDATA.sav")
library(psych)
data <- reverse.code(keys = c("soiatt_3", "fematt_3"), items = data, mini = 1, max = 9)