[R] How to save a data set as .txt on fly?

Philipp Pagel p.pagel at wzw.tum.de
Fri Nov 26 10:07:40 CET 2010


On Thu, Nov 25, 2010 at 09:23:17PM -0800, Stephen Liu wrote:
> Hi David,
> 
> 
> > But you didn't try:
> 
> > DNase    # which was after all the name of the object you saved.
> 
> Sorry I don't follow.

He is telling you that it is not surprising that 'aaa' does not exist,
if the object you saved was called DNase

 
> I can't do it with following steps:
> > DNase
> > save(DNase, file="C:/Users/satimis/Documents/dnase.txt")
> > load(file="C:/Users/satimis/Documents/dnase.txt")
> > dnase
> Error: object 'dnase' not found
> > dnase.txt
> Error: object 'dnase.txt' not found

Again - you need to use the name of the object which happens to be
'DNase' - not 'dnase', 'dnase.txt' or 'aaa'

> I'm curious to know why the .txt file created in this way can't be read with 
> Notpad and WordPad?

It can be read with them - only it does not look the way you expected.
If you want to export data for use in other software funcitons like
write.table may be of interest to you. Load and save are meant for use
in R, only.

cu
	Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/



More information about the R-help mailing list