[R] Save results

David Winsemius dwinsemius at comcast.net
Thu Jul 16 14:35:17 CEST 2009


On Jul 16, 2009, at 6:08 AM, stvienna wiener wrote:
> Have you tried:
>
> Z <- diag(10)
> write.csv(Z, file = "mymatrix.csv")
>
> type "?write.csv" to see the options to get a better result with  
> excel.
> However you can open the file "mymatrix.csv" with excel
> (it is stored in the "My Documents" folder in windows).

If you just want the same output as appears on the screen, then also  
consult:

?sink

sink(file="matx.txt")
Z
sink()

-- 
David
>
>
> 2009/7/16 Jose Narillos de Santos <narillosdesantos at gmail.com>:
>> I imagine I make a function whose results are a Matrix Z
>>
>> How cn I save in a txt or excel file the result of apply my function?
>>
>> something similar to save Z.txt.
>>
>> Thanks in advance.
>>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list