我使用下列數據集的時間表庫:爲什麼我會得到未定義的列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