Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the error "object not interpretable as a factor" mean? [closed]

Tags:

r

This:

vect <- C(1, NA, 2, 3, 4, NA, 5, NA, 6, 7, 8, NA, 9)

Produces this error:

object not interpretable as a factor

What am I doing wrong?

like image 256
Tom Avatar asked Sep 25 '14 00:09

Tom


4 Answers

This error can perhaps come up with multiple problems, but in your case you simply typed a capital C instead of a lowercase c.

Try:

vect <- c(1, NA, 2, 3, 4, NA, 5, NA, 6, 7, 8, NA, 9)
like image 133
Tom Avatar answered Nov 07 '22 20:11

Tom


if you write uppercase like C instead of c then this error will occur, and keep in mind R is case sensitive and you can't do that.

like image 45
Tech knowledge Avatar answered Nov 07 '22 20:11

Tech knowledge


Always remember that R is case sensitive. You have typed vect <- C which is uppercase. Change it to vect <- c and you will be sorted.

like image 2
vinay billa Avatar answered Nov 07 '22 21:11

vinay billa


I tried it different ways. For me it was the c between the c. For example, v2 =c(10,20,30,40,50)

v2 = (C(10,20,30,40,50)) Error in C(10, 20, 30, 40, 50) : object not interpretable as a factor

[correct version]

v2 =c(10,20,30,40,50) v2 [1] 10 20 30 40 50

like image 2
LuisMD Avatar answered Nov 07 '22 20:11

LuisMD