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. [[alternative HTML version deleted]]
Hi Jose, 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). Ok, hope that helps. Next time you can try also a goolge search like "r-help csv". Regards, Steve 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. > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >
Have a look at ?write.table ------------------------------------------------------------------------ ---- ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -----Oorspronkelijk bericht----- Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Namens Jose Narillos de Santos Verzonden: donderdag 16 juli 2009 11:31 Aan: r-help at r-project.org Onderwerp: [R] Save results 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. [[alternative HTML version deleted]] ______________________________________________ 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. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
Hi r-help-bounces at r-project.org napsal dne 16.07.2009 11:31:25:> 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.write.table(tab, "clipboard", sep = "\t", row.names = F) to paste to spreadsheet through clipboard or write.table(tab, "Z.txt", sep = "\t", row.names = F) to write to file. see ?write.table Regards Petr> > Thanks in advance. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
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