[R] how to export.RDA file to a text file?

Charles C. Berry cberry at tajo.ucsd.edu
Tue Sep 25 04:08:25 CEST 2007


On Mon, 24 Sep 2007, Stephen Weigand wrote:

> On 9/24/07, Jittima Piriyapongsa <gtg894p at mail.gatech.edu> wrote:
>> Hi,
>>
>> Does anyone know how to export .RDA file (in R program) to a normal text file
>> (readable by any text editor)?

Is this what you mean?

 	load( "old.RDA" )
 	save( list=ls(), file='new.rda' , ascii = TRUE )

This is literally readable by a text editor, and you can change the 
objects in that file.

But you need to have a _deep_ understanding of the format to avoid 
breaking things. And I doubt that those who have that understanding would 
ever attempt to edit such a file with a text editor.

Please refer to the _posting guide_ and revise your question if this or 
Stephen's response did not answer your question.

Chuck

Also, how to export an object in R program into a
>> text file (not .RDA file)?
>>
>> Thank you.
>> Jittima
>
> You may be used to the idea that there are code files and data files
> and that's it. But an .RDA file is a saved version of one or more R
> objects of any kind and therefore may contain a data set (stored as a
> data.frame), a fitted regression model, AND a vector (for example).
>
> Maybe do:
>
> load("yourfile.RDA")
> ls()
>
> to see what you have in yourfile.RDA and then perhaps do
>
> help(write.table)
>
> to learn how to write out a matrix or data.frame as a text file if
> that's what you're trying to do.
>
> Hope this helps,
>
> Stephen
>
> -- 
> Rochester, Minn. USA
>
> ______________________________________________
> 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.
>

Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901



More information about the R-help mailing list