rwatkins@cornerstonelp.com
2003-May-23 11:10 UTC
[R] Not getting all data to a text file via write.table
Hi all- Thanks in advance for your help. I have a 2275x1 table of residuals from an lm() regression. I want to analyze this further in Excel. I tried using: df<-resid(object) write.table(df) and this yields a nice looking output in R, but because of screen constraints, I seem to loose data "out-the-top" of the Console -- which doesn't bother me, as long as I can see it eventually. But when i clicked on the RGui tool bar File|Save to file|, etc., only what I could see in the Console seemed to be saved to the text file. Obviiously, I am a newbie -- How can I get the entire output into this textfile? Again, thanks! Enjoy the Holiday weekend!
Spencer Graves
2003-May-23 11:34 UTC
[R] Not getting all data to a text file via write.table
?write.table reveals a second argument "file". Have you considered "write.table(df, 'df.csv')"? I've imported *.csv files produced by "write.table" into Excel many times, so I think this should work for you. By the way, "df" is the density function for the F distribution. It is also the degrees of freedom argument for Student's t distribution functions, etc. It is therefore considered poor style to use "df" as the name of a data.frame or some other object. hth. spencer graves rwatkins at cornerstonelp.com wrote:> Hi all- Thanks in advance for your help. > > I have a 2275x1 table of residuals from an lm() regression. I want to > analyze this further in Excel. I tried using: > > df<-resid(object) > write.table(df) > > and this yields a nice looking output in R, but because of screen > constraints, I seem to loose data "out-the-top" of the Console -- which > doesn't bother me, as long as I can see it eventually. But when i clicked > on the RGui tool bar File|Save to file|, etc., only what I could see in the > Console seemed to be saved to the text file. > > Obviiously, I am a newbie -- How can I get the entire output into this > textfile? > > Again, thanks! Enjoy the Holiday weekend! > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Peter Dalgaard BSA
2003-May-23 12:01 UTC
[R] Not getting all data to a text file via write.table
<rwatkins at cornerstonelp.com> writes:> Hi all- Thanks in advance for your help. > > I have a 2275x1 table of residuals from an lm() regression. I want to > analyze this further in Excel. I tried using: > > df<-resid(object) > write.table(df) > > and this yields a nice looking output in R, but because of screen > constraints, I seem to loose data "out-the-top" of the Console -- which > doesn't bother me, as long as I can see it eventually. But when i clicked > on the RGui tool bar File|Save to file|, etc., only what I could see in the > Console seemed to be saved to the text file. > > Obviiously, I am a newbie -- How can I get the entire output into this > textfile?There's a file= argument to write.table. That's the right way to do it, but you can increase the amount saved in the console too, on the GUI Preferences menu I think. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Jan_Svatos@eurotel.cz
2003-May-23 12:31 UTC
[R] Not getting all data to a text file via write.table
Hi, look more deeply at ?write.table>From wite.table help:`write.table' prints its required argument `x' (after converting it to a data frame if it is not one already) to `file'. The entries in each line (row) are separated by the value of `sep'. Therefore,>write.table(df, file=myfile.csv, sep=";")gives the exact output independent on screen constraints. Or try>library(MASS) >?write.matrixBTW, R as really excellent statistical software has MUCH better tools for analysis of residuals than any spreadsheet calculator including Excel, therefore I use R for such analysis. Try>?lm.influenceHTH, Jan - - - Original message: - - - From: r-help-bounces at stat.math.ethz.ch Send: 23.5.2003 13:14:07 To: "R Help" <r-help at stat.math.ethz.ch> Subject: [R] Not getting all data to a text file via write.table Hi all- Thanks in advance for your help. I have a 2275x1 table of residuals from an lm() regression. I want to analyze this further in Excel. I tried using: df<-resid(object) write.table(df) and this yields a nice looking output in R, but because of screen constraints, I seem to loose data "out-the-top" of the Console -- which doesn't bother me, as long as I can see it eventually. But when i clicked on the RGui tool bar File|Save to file|, etc., only what I could see in the Console seemed to be saved to the text file. Obviiously, I am a newbie -- How can I get the entire output into this textfile? Again, thanks! Enjoy the Holiday weekend! ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help