consistently getting recode error when trying to change likert to numeric

Hi all,

I tried using recode which has worked for previous work but seems not to work for this dataset.

here is what I tried:

data_recode <- Version_A %>% mutate(NBIIA1 = recode(NBIIA1, "Strongly Disagree (-3)" = "1", "-2" = "2", "-1" = "3", "Neither Agree nor Disagree (0)" = "4", "1" = "5", "2" = "6", "Strongly Agree (3)" = "7"))

i have also tried:

recode_a <- recode(Version_A$NBIIA1, "Strongly Disagree (-3)" = 1, "-2" = 2, "-1" = 3, "Neither Agree nor Disagree (0)" = 4, "1" = 5, "2" = 6, "Strongly Agree (3)" = 7)%>%

which worked but when it created the new data frame the column was named "." (also I need to do this for 25 columns and 4 versions)

So if anyone knows a more efficient way, or just anyway to get it to work it would be much appreciated!!!!

Thanks for providing code. Could you kindly take further steps to make it easier for other forum users to help you? Share some representative data that will enable your code to run and show the problematic behaviour.

How do I share data for a reprex?

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.