I am new to R and trying to recode ordinal variables to numeric values. i have a variable named 'Founders_previous_company_employee_count' having 3 different entries as inputs-("Small","Medium","Large") which i am recording it to 1,2,3 values respectively. I tried using revalue function from plyr package using the below code
startupfull$employee_count_code<-as.numeric(revalue(startupfull$Founders_previous_company_employee_count,c("Small"=1, "Medium"=2, "Large"=3)))
which works fine. However, i try using recode function in dplyr package, I am getting error message.
Code:
startupfull$prevcomp_empcount_code <- as.numeric(recode(startupfull$Founders_previous_company_employee_count,c("Small"=1, "Medium"=2, "Large"=3)))
Error- Error: All replacements must be named
What am I doing wrong here?