I don't remember which version View was added in, but it was more recent than 2.4.1. I would suggest upgrading (2.4.1 is ancient in R terms).
You can get something similar with: > invisible(edit(mydata)) But you will have to close the window to continue with R (View lets you look at the data (but not edit it), while still working at the command prompt). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 From: Michael Just [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2008 1:03 AM To: Greg Snow Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] Options for viewing / using results from lm Hello, Thanks for the response. However, I have this problem with view. > View(fit1) Error: could not find function "View" I have R 2.4.1 and even tried loading 'utils'. As for saving residuals in a spreadsheet I used something like this: res.fit1<-fit1$residuals res.fit2<-fit2$residuals .... write.csv(res.fit1, file="res.fit1.csv") write.csv(res.fit2, file="res.fit2.csv") Thanks, M Just On Tue, Sep 23, 2008 at 9:07 PM, Greg Snow <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: The View function (note the uppercase V) is in the utils package, one of the standard ones that loads automatically. ________________________________ From: Michael Just [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] Sent: Tuesday, September 23, 2008 2:49 PM To: Greg Snow Cc: r-help@r-project.org<mailto:r-help@r-project.org>; [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> Subject: Re: [R] Options for viewing / using results from lm Greg, Thanks for the pseudocode and cbind suggestions I think these should be quite helpful. What package is the function 'view' in? As for exporting elsewhere, basically I would to have the values of residuals saved in a spreadsheet in addition to any visualizations created within R. Thanks, M Just On Tue, Sep 23, 2008 at 3:26 PM, Greg Snow <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: You can do things like this pseudocode: > fit1 <- lm( y ~ x1, data=mydata ) > fit2 <- lm( y ~ x2, data=mydata ) > fit3 <- lm( y ~ x1*x2, data=mydata ) ... > mydata$r1 <- resid(fit1) > mydata$r2 <- resid(fit2) > mydata$r3 <- resid(fit3) Or > mydata <- cbind(mydata, r1=resid(fit1), r2=resid(fit2), ... To view the data in a spreadsheet like table: > View(mydata) And scroll over to the r columns, using indexing or the subset function can reorder the columns to make this easier. A simple plot: > pairs( mydata[ , paste('r',1:10, sep='')], col=c('red','green','blue')[ > mydata$g1 ], + panel=panel.smooth ) Or there are various other ways to explore the data within R. If you really feel the need to use another tool, do like the above, then use write.table to export it to a csv file or paste it to a spreadsheet. There is also the rggobi package which will automate the exporting to the ggobi program which allows a lot more visualization options. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> 801.408.8111 > -----Original Message----- > From: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> [mailto:[EMAIL > PROTECTED]<mailto:[EMAIL PROTECTED]> > project.org<http://project.org>] On Behalf Of Michael Just > Sent: Tuesday, September 23, 2008 2:06 PM > To: r-help@r-project.org<mailto:r-help@r-project.org> > Cc: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> > Subject: Re: [R] Options for viewing / using results from lm > > Hello, > > >Why do you think it is better done in another program? Keeping it in R > saves you from the exporting, which you say you are having trouble > with. > > I think it might be better for viewing capabilities. If I had columns > of > residuals right next to each other I could spot differences amongst > locations. Right? If I can take the residual values and put them back > into > my main data file I can then have the options to use grouping values > that > exist there. (Like I asked here: > http://tolstoy.newcastle.edu.au/R/e5/help/08/09/2186.html) > > >> Q2: How can I take the residuals and create an object(s) for further > <http://tolstoy.newcastle.edu.au/R/e5/help/08/09/2259.html#2265qlink2>* > analysis. > * > ** > > >See ?residuals. > > >Try the following: > > >x <- sample(1:20, 100, replace=TRUE) > >y <- rnorm(100) > >fit.lm <- lm(y ~ x) > >plot(residuals(fit.lm)) > >plot(x,residuals(fit.lm)) > > > When I was thinking further analysis, for example, could I take the > residuals for all metrics in one extent and compare them to all > residuals > for all metrics in another extent? Even though the were created with 16 > different models? > > In 'plot(residuals(fit.lm))' what is the index 'counting'? > > > Thank you kindly for you $0.25, > > Cheers, > > M Just > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org<mailto:R-help@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. [[alternative HTML version deleted]] ______________________________________________ R-help@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.