Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
向R中的数据集添加空发生级别_R - Fatal编程技术网

向R中的数据集添加空发生级别

向R中的数据集添加空发生级别,r,R,假设我有以下数据,这是总结 summary(mydata) 1 2 3 4 8 9 10 11 12 11 45 25 3 23 52 126 2 4 及 其中,水平表示12点钟方向的碰撞方向 如何添加空发生因子? 例如5,6,7levels(x)或levels(x)或levels(x)@RichardScriven,它比seq_len(12)少7个字符好多少呢:P levels(mydata) [1] "1" "2" "3" "4

假设我有以下数据,这是总结

 summary(mydata)
 1   2   3   4   8   9  10  11  12 
 11  45  25   3  23  52 126   2   4 

其中,
水平
表示12点钟方向的碰撞方向

如何添加空发生因子?
例如5,6,7

levels(x)或
levels(x)或
levels(x)@RichardScriven,它比
seq_len(12)
少7个字符好多少呢:P
levels(mydata)
[1] "1"  "2"  "3"  "4"  "8"  "9"  "10" "11" "12"