[R] Problems Exporting R Output to an xls file need help

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon May 7 08:58:57 CEST 2012


Petr, your code does not create a native Excel file, and it is misleading to name it with an xls extension.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Petr PIKAL <petr.pikal at precheza.cz> wrote:

>Hi
>
>Or you can use base function
>
>write.table(varxls, file="some output file.xls", sep = "\t", row.names
>= 
>F)
>
>Regards
>Petr
>
>> 
>> As it says, you need to supply a file name to be outputted to.
>> 
>> write.xls(...., file = "abc.xls")
>> 
>> Michael
>> 
>> On Fri, May 4, 2012 at 11:31 AM, PaulJr <paulbernal07 at gmail.com>
>wrote:
>> > Hello R users,
>> >
>> > I want to export to an xls or .csv some predictions I produced with
>
>the
>> > auto.arima and forecast functions.
>> >
>> > A detail of all my work is presented below. I loaded a package
>called
>> > dataframes2xls and tried to use the  function write.xls without any
>
>success.
>> >
>> > Can anybody help me figure this out? How could I get R to export
>the 
>output
>> > to an xls file?
>> >
>> > Any help will be greatly appreciated.
>> >
>> >> dryfit<-auto.arima(testing1$pcumsdry)
>> >> dryfit
>> > Series: testing1$pcumsdry
>> > ARIMA(2,1,1) with drift
>> >
>> > Coefficients:
>> >         ar1    ar2      ma1       drift
>> >      0.2684  0.109  -0.8906  -15265.776
>> > s.e.  0.1145  0.102   0.0798    8047.169
>> >
>> > sigma^2 estimated as 2.869e+11:  log likelihood=-2265.02
>> > AIC=4540.03   AICc=4540.43   BIC=4555.25
>> >> forecast(dryfit, h=60)
>> >    Point Forecast   Lo 80   Hi 80   Lo 95   Hi 95
>> > 157        4074831 3388438 4761224 3025083 5124579
>> > 158        4091730 3357988 4825473 2969569 5213892
>> > 159        4082508 3316633 4848383 2911204 5253812
>> > 160        4072372 3289497 4855247 2875069 5269675
>> > 161        4059142 3263395 4854890 2842151 5276133
>> > 162        4044982 3238520 4851444 2811605 5278359
>> > 163        4030235 3214025 4846446 2781949 5278522
>> > 164        4015229 3189787 4840672 2752824 5277635
>> > 165        4000090 3165706 4834474 2724010 5276170
>> > 166        3984886 3141748 4828025 2695417 5274355
>> > 167        3969651 3117892 4821410 2666998 5272304
>> > 168        3954400 3094129 4814672 2638728 5270072
>> > 169        3939142 3070452 4807832 2610595 5267689
>> > 170        3923880 3046856 4800903 2582588 5265171
>> > 171        3908616 3023340 4793891 2554704 5262527
>> > 172        3893351 2999901 4786800 2526937 5259764
>> > 173        3878085 2976536 4779635 2499284 5256886
>> > 174        3862820 2953243 4772397 2471742 5253898
>> > 175        3847554 2930020 4765088 2444307 5250802
>> > 176        3832288 2906866 4757711 2416976 5247600
>> > 177        3817023 2883778 4750267 2389748 5244297
>> > 178        3801757 2860755 4742758 2362619 5240895
>> > 179        3786491 2837796 4735186 2335587 5237395
>> > 180        3771225 2814899 4727552 2308650 5233801
>> > 181        3755960 2792062 4719857 2281805 5230114
>> > 182        3740694 2769284 4712104 2255051 5226337
>> > 183        3725428 2746564 4704292 2228384 5222472
>> > 184        3710162 2723900 4696425 2201804 5218521
>> > 185        3694896 2701291 4688502 2175308 5214485
>> > 186        3679631 2678736 4680525 2148894 5210367
>> > 187        3664365 2656234 4672496 2122561 5206169
>> > 188        3649099 2633783 4664415 2096307 5201891
>> > 189        3633833 2611383 4656284 2070130 5197536
>> > 190        3618568 2589032 4648103 2044029 5193106
>> > 191        3603302 2566730 4639874 2018002 5188602
>> > 192        3588036 2544475 4631597 1992047 5184025
>> > 193        3572770 2522266 4623274 1966163 5179377
>> > 194        3557504 2500104 4614905 1940349 5174659
>> > 195        3542239 2477986 4606492 1914604 5169873
>> > 196        3526973 2455911 4598035 1888925 5165020
>> > 197        3511707 2433880 4589534 1863313 5160101
>> > 198        3496441 2411891 4580992 1837765 5155118
>> > 199        3481176 2389943 4572408 1812280 5150071
>> > 200        3465910 2368036 4563783 1786857 5144962
>> > 201        3450644 2346169 4555119 1761496 5139792
>> > 202        3435378 2324341 4546415 1736194 5134562
>> > 203        3420112 2302552 4537673 1710951 5129273
>> > 204        3404847 2280801 4528893 1685767 5123927
>> > 205        3389581 2259087 4520075 1660639 5118523
>> > 206        3374315 2237409 4511221 1635567 5113063
>> > 207        3359049 2215767 4502332 1610550 5107549
>> > 208        3343784 2194161 4493406 1585587 5101980
>> > 209        3328518 2172589 4484446 1560678 5096358
>> > 210        3313252 2151052 4475452 1535820 5090684
>> > 211        3297986 2129548 4466424 1511015 5084958
>> > 212        3282720 2108078 4457363 1486259 5079181
>> > 213        3267455 2086640 4448270 1461554 5073355
>> > 214        3252189 2065234 4439144 1436898 5067480
>> > 215        3236923 2043860 4429987 1412290 5061556
>> > 216        3221657 2022517 4420798 1387730 5055585
>> >> utils:::menuInstallLocal()
>> > package 'dataframes2xls' successfully unpacked and MD5 sums checked
>> >> varxls<-forecast(dryfit, h=60)
>> >> write.xls(varxls)
>> > Error: could not find function "write.xls"
>> >> library(dataframes2xls)
>> >> write.xls(varxls)
>> > [1] "Does 'python' exist, and is it in the path?"
>> > Error in paste("-o ", file, " ", sep = "") :
>> >  argument "file" is missing, with no default
>> >
>> >
>> > --
>> > View this message in context:
>http://r.789695.n4.nabble.com/Problems-
>> Exporting-R-Output-to-an-xls-file-need-help-tp4608912.html
>> > Sent from the R help mailing list archive at Nabble.com.
>> >
>> > ______________________________________________
>> > R-help at r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide 
>http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide 
>http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list