[R] Several simple but hard tasks to do with R

David Winsemius dwinsemius at comcast.net
Thu Aug 20 19:06:06 CEST 2009


On Aug 20, 2009, at 10:59 AM, Rakknar wrote:

>
> "To echo what others have said, it is often easier to write a script  
> (in
> STATA terms, a "do" file) of commands and then "source" the script.  
> When
> it runs to your satisfaction, usually not the first time for me, there
> are several ways to store the output. Both the R2HTML and prettyR
> packages contain methods to store output as HTML files. You can store
> both the commands and output in the same file."
>
> I already using script. I'm using Tinn-R to write them. Thanks for the
> recommendation of the R2HTML package I'll see how to use it right now.
> Thanks.
>
> "You can save one object at a time if you want, and do it during a
> script. I usually save the primary data object after I have translated
> it from whatever format it came to me. You can save subsets of the  
> data
> as different files and simply use "load" to read in the data you want.
> "load" can also signal if the data is not there, albeit in a fairly
> messy way."
>
> Yes, I already know I can do things that way but it doesn't work for  
> me: I
> want to be able to store several objects in one .Rdata file in a  
> flexible
> and fast way. Writing one for each object seems too messy for me.

You do not need to repeat save() operations for multiple objects. A  
single save will bundle multiple objects:

save(xx, dff, v, file="test.Rdta')  # saves three objects in one file.

-- 

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list