错误“不能解释为一个因素”是什么意思?

时间:2021-05-19 16:56:32

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?

我做错了什么?

2 个解决方案

#1


31  

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

这个错误可能会产生多个问题,但是在您的情况下,您只需输入一个大写C而不是小写的C。

Try:

试一试:

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

#2


2  

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.

记住R是区分大小写的。您已经输入了vect <- C,它是大写的。更改为vect <- c,您将被排序。

#1


31  

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

这个错误可能会产生多个问题,但是在您的情况下,您只需输入一个大写C而不是小写的C。

Try:

试一试:

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

#2


2  

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.

记住R是区分大小写的。您已经输入了vect <- C,它是大写的。更改为vect <- c,您将被排序。