我收到的時候我嘗試使用str
功能R.
這裏的錯誤數據:錯誤使用上data.frame海峽
> dput(data1)
data1<- structure(list(Year = 1990:2010, Counts = c(1401L, 1290L, 1168L,1260L, 1252L, 1381L, 1330L, 1275L, 1235L, 1248L, 1237L, 1206L, 1175L, 1172L, 1055L, 1030L, 1002L, 987L, 915L, 806L, 868L)), .Names = c("Year", "Counts"), class = "data.frame", row.names = c(NA, -21L))
我不知道爲什麼R的給我與str
以下錯誤,而class
函數明確表示data1是data.frame
。
> class(data1)
[1] "data.frame"
> str(data1)
Error in str(data1) :
unable to find a non-generic version of function "str"
我對Windows使用R版本2.15.0(2012-03-30)。
任何幫助將不勝感激。
編輯: 隨着乾淨的R會話它的工作。但爲什麼會出現這種問題呢?是否有可能知道這一點?
我也在Windows上使用R 2.15,它適用於我。你有沒有嘗試一個乾淨的R會議? – Sophia
我沒有收到錯誤消息。我複製並粘貼了你的data1,並沒有使用dput語句。 –
Thanks @MarkMiller請看我的編輯 –