Skip to content

Save the elements of an atomic vector to a text fil

7 messages · jim holtman, Usuario R, johnhj +1 more

#
Hii,

I will save the elements of the vector median<-with(x, tapply(V3, grup,
median)). The output of this vector is:

 25   50   75  100  125  150  175  200  225  250  275  300  325  350  375 
400  425  450  475  500  
17.8 17.8 17.5 17.8 17.7 17.6 17.7 17.6 17.8 17.7 17.6 17.7 17.8 17.7 17.8
17.8 17.8 17.8 17.7 17.7 

Can anybody help me how to do it. I will save it to a text file...

greetings,
johnh
#
'str(x)' would help.  I assume that this is a named list, so this
might plot it for you:

plot(names(x), x)
On Fri, Mar 13, 2009 at 10:59 AM, johnhj <jharris at web.de> wrote:

  
    
#
?cat
On Mar 13, 2009, at 10:59 AM, johnhj wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
Thank you all,

I did it with "write.table"...

greetings,
johnh
johnhj wrote:

  
    
3 days later
#
I can save a atomic vector with the write.table function so far...

But how can I save 2 vectors to a text file ? I tried to do it by "merging"
2 vector to 1 vector like this here:

summary_vector<-c(vector1, vector2)

and tried to write the contents of summary_vector to a textfile with:

write.table(summary_vector, file= "(my file etc.)")

But I cann't write 2 vectors with this function to a file...
can anybody help how to do ?

greetings,
johnh
Usuario R wrote:

  
    
#
<http://cran.r-project.org/doc/manuals/R-data.pdf>

--  
David Winsemius
On Mar 16, 2009, at 4:35 PM, johnhj wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT