R 函数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"
这是dput()
输出VaRStats
:
> 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
函数产生的错误
> 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'
这怎么可能?