R使用两个因子将原始数据拆分为矩阵数据

时间:2017-11-24 06:31:54

标签: r split zoo raw-data

嗨我有问题

#  Place  Factor Value
#1 place1 fac1   10
#2 place1 fac2   20
#3 place1 fac3   30
#4 place1 fac5   50
#5 place2 fac1   40
#6 place2 fac2   50
#7 place2 fac3   60
#8 place2 fac4   60

我想将此数据发送到

#  Factor place1 place2
#1 fac1   10     40
#2 fac2   20     50
#3 fac3   30     60
#4 fac4   0      60
#5 fac5   50     0

我尝试使用

read.zoo(data,index='Factor',split='Place)

但它不起作用。

出现此错误消息

Error in read.zoo(c, index = "SIGUN", split = "MCLASSNAME") : index has 2420 bad entries at data rows: 1 2 3 4 ...

0 个答案:

没有答案