我使用下列数据集的时间表库:为什么我会得到未定义的列err?
'data.frame': 3951 obs. of 4 variables:
$ Problem : chr "A" "B" "C" "D" ...
$ Device : chr "V" "W" "V" "W" ...
$ StartDate: Date, format: "2008-01-24" "2008-01-11" ...
$ EndDate : Date, format: "2007-11-25" "2007-10-16" ...
这正是由库的二战所提供的相同的数据结构:
'data.frame': 8 obs. of 4 variables:
$ Person : chr "Franklin D. Roosevelt" "Harry S. Truman" "Stanley\nBaldwin" "Neville\nChamberlain" ...
$ Group : chr "US President" "US President" "UK Prime Minister" "UK Prime Minister" ...
$ StartDate: Date, format: "1933-03-04" "1945-04-12" ...
$ EndDate : Date, format: "1945-04-12" "1953-01-20" ...
我跑后
timeline(df,group.col=df$Problem,start.col=df$StartDate,end.col=df$EndDate)
返回
Error in `[.data.frame`(df, , start.col) : undefined columns selected
即使我尝试不同的str,如df [,1],它也会返回相同的错误。我误解了什么?
如果您发布dput(DF)的输出这里将是有益的。 – rnso 2014-10-16 13:25:07