This question is somewhat related to a question i asked [R: Using Apply Function to clean likert answers](https://stackoverflow.com/questions/35819788/r-using-apply-function-to-clean-likert-answers/35820186#35820186)

I have a likert scale but everything is text. I wish to convert the columns to factors and then to numbers. There are missing values in the answers

```
df[,104:123] <- as.numeric(apply(df[,104:105], 2, 
                                  function (x) factor(x,levels =  c("NEVER","RARELY","SOMETIMES","MOST OF THE TIME","ALWAYS"))))

```

I however get the following error: `Warning message:
NAs introduced by coercion`

IN fact it has converted everything to `NA`
I ran the code without the `as.numeric` conversion and it seems ok

Below is the output for two columns
`apply(df[,104:123], 2, function(x) unique(x))`

```
$Ans.1
[1] ""                 "SOMETIMES"        "MOST OF THE TIME"   "RARELY"           "ALWAYS"           "NEVER"           

$Ans.2.
[1] ""                 "SOMETIMES"        "MOST OF THE TIME" "RARELY"           "ALWAYS"           "NEVER" 

```

Can anyone see the problem in my code

Thanks