R函數write.csv
返回錯誤。函數write.csv返回錯誤
這是我想寫的data.frame:
> VaRStats
A Index B Index C Index
Daily VaR -0.65006 -0.50391 -0.5557
Daily CVaR -0.75679 -0.57491 -0.65174
5 Days VaR -1.4204 -1.0077 -1.2269
這裏的類VaRStats
:
> class(VaRStats)
[1] "data.frame"
而這裏的VaRStats
的dput()
輸出:
> dput(VaRStats)
structure(list(`JWFXA Index` = structure(list(`NA` = -0.650061101980277,
`NA` = -0.756791819719978, `JWFXA Index` = -1.42035638029947), .Names = c(NA,
NA, "JWFXA Index")), `CCYT1 Index` = structure(list(`NA` = -0.503912574910245,
`NA` = -0.574907003405759, `CCYT1 Index` = -1.00773735259718), .Names = c(NA,
NA, "CCYT1 Index")), `FX Multistrategy Index` = structure(list(
`NA` = -0.555699685451229, `NA` = -0.651738541799373, `FX Multistrategy Index` = -1.22688572580144), .Names = c(NA,
NA, "FX Multistrategy Index"))), .Names = c("JWFXA Index", "CCYT1 Index",
"FX Multistrategy Index"), row.names = c("Daily VaR", "Daily CVaR",
"5 Days VaR"), class = "data.frame")
的通過產生的錯誤功能
> write.csv(VaRStats, "SummaryStats.csv")
Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), :
type 'list' not implemented in 'EncodeElement'
這怎麼可能?
工作正常,我...必須有缺少一塊你不提供。 – 2013-03-15 13:53:15
這裏工作也很好。也許你可以在你的'VaRStats'對象上覆制/粘貼'dput'? – juba 2013-03-15 13:54:21
我最近有一個類似的奇怪的錯誤 - 它通過簡單地重新啓動R被修復。 – alexwhan 2013-03-15 13:56:02