Hanlie Pretorius
2011-Jul-19 14:58 UTC
[R] Writing the output of a regression object to a file
Hi, I'm using R 2.12.0 on Windows XP. I've used the e1071 package to tune a Support Vector Regression object and I've created the SVR object:> epsilon.svr <- svm(C8R004 ~.,data = rain_flow.train, scale = T, type = "eps-regression",+ kernel = "radial", cost = 0.9, epsilon=0.55,tolerance=0.001, shrinking=T, gamma=0.18,fitted=T)> esvr.pred <- predict(epsilon.svr,newdata = rain_flow.test)I would like to export the esvr.pred object to a file so that I can draw a graph of it against my original data in other software that I'm using. I've tried the write.svm command, but that outputs the scaled data instead of something that I can directly compare to my original data. Does anyone know of an easy way to get the result such a format? Alternatively, how can I use the scale values to generate such a format? Thanks Hanlie
If I understand you correctly,> I would like to export the esvr.pred object to a file so that I can > draw a graph of it against my original data in other software that I'm > using. >you cannot do this. You can export **data**, but of course any R "object" is either a binary or text (via dput) representation of an R structure, which can only be understood by R, not another software system. See ?write, ?write.table, or the R import/export manual for how to export data (as text) to be imported by other software. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics