The R function write.csv returns an error.
Here data.frame I want to write:
> 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
Here's the VaRStats class:
> class(VaRStats) [1] "data.frame"
And here is the output of 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")
Error created using write.csv function
> 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'
How is this possible?