Thank you for the suggestion. Yes, it does seem to be a bit counter-intuitive, but that is the output I am being asked to produce. I have only been using R for a few weeks, so there is probably a better way to do it. Anyway, your suggestion did work, but only up to 337 data points. I am dealing with ~100,000 data points so this doesn't really work for me. Is there another method you would suggest? My goal is to plot multiple regression planes (without points) in an interactive 3d plot. Thank you, Jeff On Fri, Oct 2, 2015 at 5:22 PM, Fox, John <jfox at mcmaster.ca> wrote:> Dear Jeff, > > I'm tempted to say that a scatterplot without points is an oxymoron, but > that wouldn't be very helpful. > > Actually, the scatter3d() function used by the Rcmdr is in the car > package. The Rcmdr 3D scatterplot dialog doesn't provide for suppressing > the points, but if you add radius=rep(0, n) to the command that's > generated, where you'd replace n with the number of cases in the dataset, > that would do the trick by plotting spheres of 0 radius. For example, try > > scatter3d(prestige ~ income + education, data=Duncan, > radius=rep(0, 45), residuals=FALSE) > > either in the Rcmdr or at the R command prompt. > > For more information see ?scatter3d or press the Help button in the Rcmdr > 3D scatterplot dialog and follow the link to scatter3d. > > I hope this helps, > John > > ----------------------------- > John Fox, Professor > McMaster University > Hamilton, Ontario > Canada L8S 4M4 > Web: socserv.mcmaster.ca/jfox > > > > > -----Original Message----- > > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff > > Tostenrude > > Sent: October 2, 2015 7:34 PM > > To: r-help at r-project.org > > Subject: [R] scatter3d > > > > I am using scatter3d in R Commander to plot a group of regression > surfaces. > > However, I only want to display the surfaces. How do I remove the points? > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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]]
On 03.10.2015 05:45, Jeff Tostenrude wrote:> Thank you for the suggestion. Yes, it does seem to be a bit > counter-intuitive, but that is the output I am being asked to produce. I > have only been using R for a few weeks, so there is probably a better way > to do it. > > Anyway, your suggestion did work, but only up to 337 data points. I am > dealing with ~100,000 data points so this doesn't really work for me. Is > there another method you would suggest? My goal is to plot multiple > regression planes (without points) in an interactive 3d plot.What does "interactive" mean here? Do you want to turnit around or do you want brushing like interactivity? For the former, I highly suggest to look at the rgl package Best, Uwe Ligges> Thank you, > Jeff > > On Fri, Oct 2, 2015 at 5:22 PM, Fox, John <jfox at mcmaster.ca> wrote: > >> Dear Jeff, >> >> I'm tempted to say that a scatterplot without points is an oxymoron, but >> that wouldn't be very helpful. >> >> Actually, the scatter3d() function used by the Rcmdr is in the car >> package. The Rcmdr 3D scatterplot dialog doesn't provide for suppressing >> the points, but if you add radius=rep(0, n) to the command that's >> generated, where you'd replace n with the number of cases in the dataset, >> that would do the trick by plotting spheres of 0 radius. For example, try >> >> scatter3d(prestige ~ income + education, data=Duncan, >> radius=rep(0, 45), residuals=FALSE) >> >> either in the Rcmdr or at the R command prompt. >> >> For more information see ?scatter3d or press the Help button in the Rcmdr >> 3D scatterplot dialog and follow the link to scatter3d. >> >> I hope this helps, >> John >> >> ----------------------------- >> John Fox, Professor >> McMaster University >> Hamilton, Ontario >> Canada L8S 4M4 >> Web: socserv.mcmaster.ca/jfox >> >> >> >>> -----Original Message----- >>> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff >>> Tostenrude >>> Sent: October 2, 2015 7:34 PM >>> To: r-help at r-project.org >>> Subject: [R] scatter3d >>> >>> I am using scatter3d in R Commander to plot a group of regression >> surfaces. >>> However, I only want to display the surfaces. How do I remove the points? >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> 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 at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >
On 02/10/2015 11:45 PM, Jeff Tostenrude wrote:> Thank you for the suggestion. Yes, it does seem to be a bit > counter-intuitive, but that is the output I am being asked to produce. I > have only been using R for a few weeks, so there is probably a better way > to do it. > > Anyway, your suggestion did work, but only up to 337 data points. I am > dealing with ~100,000 data points so this doesn't really work for me. Is > there another method you would suggest? My goal is to plot multiple > regression planes (without points) in an interactive 3d plot.The problem there would be that 100000 spheres will overwhelm the graphics system, even if they are of size zero. The ?planes3d help page shows how to plot a plane based on a linear fit. It won't include the grid that scatter3d includes; you would need to program that separately. You should avoid using the rgl.lines and rgl.quads calls that scatter3d uses; you're better off with lines3d and quads3d. If you don't include any points, you'll need to specify the range of the axes explicitly --- use the xlim, ylim and zlim arguments to decorate3d to do that. Duncan Murdoch> > Thank you, > Jeff > > On Fri, Oct 2, 2015 at 5:22 PM, Fox, John <jfox at mcmaster.ca> wrote: > >> Dear Jeff, >> >> I'm tempted to say that a scatterplot without points is an oxymoron, but >> that wouldn't be very helpful. >> >> Actually, the scatter3d() function used by the Rcmdr is in the car >> package. The Rcmdr 3D scatterplot dialog doesn't provide for suppressing >> the points, but if you add radius=rep(0, n) to the command that's >> generated, where you'd replace n with the number of cases in the dataset, >> that would do the trick by plotting spheres of 0 radius. For example, try >> >> scatter3d(prestige ~ income + education, data=Duncan, >> radius=rep(0, 45), residuals=FALSE) >> >> either in the Rcmdr or at the R command prompt. >> >> For more information see ?scatter3d or press the Help button in the Rcmdr >> 3D scatterplot dialog and follow the link to scatter3d. >> >> I hope this helps, >> John >> >> ----------------------------- >> John Fox, Professor >> McMaster University >> Hamilton, Ontario >> Canada L8S 4M4 >> Web: socserv.mcmaster.ca/jfox >> >> >> >>> -----Original Message----- >>> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff >>> Tostenrude >>> Sent: October 2, 2015 7:34 PM >>> To: r-help at r-project.org >>> Subject: [R] scatter3d >>> >>> I am using scatter3d in R Commander to plot a group of regression >> surfaces. >>> However, I only want to display the surfaces. How do I remove the points? >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> 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 at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >
Oh yes, I meant for plotting planes, not points, of course. Uwe On 03.10.2015 13:52, Duncan Murdoch wrote:> On 02/10/2015 11:45 PM, Jeff Tostenrude wrote: >> Thank you for the suggestion. Yes, it does seem to be a bit >> counter-intuitive, but that is the output I am being asked to produce. I >> have only been using R for a few weeks, so there is probably a better way >> to do it. >> >> Anyway, your suggestion did work, but only up to 337 data points. I am >> dealing with ~100,000 data points so this doesn't really work for me. Is >> there another method you would suggest? My goal is to plot multiple >> regression planes (without points) in an interactive 3d plot. > > The problem there would be that 100000 spheres will overwhelm the > graphics system, even if they are of size zero. > > The ?planes3d help page shows how to plot a plane based on a linear fit. > It won't include the grid that scatter3d includes; you would need to > program that separately. You should avoid using the rgl.lines and > rgl.quads calls that scatter3d uses; you're better off with lines3d and > quads3d. > > If you don't include any points, you'll need to specify the range of the > axes explicitly --- use the xlim, ylim and zlim arguments to decorate3d > to do that. > > Duncan Murdoch > >> >> Thank you, >> Jeff >> >> On Fri, Oct 2, 2015 at 5:22 PM, Fox, John <jfox at mcmaster.ca> wrote: >> >>> Dear Jeff, >>> >>> I'm tempted to say that a scatterplot without points is an oxymoron, but >>> that wouldn't be very helpful. >>> >>> Actually, the scatter3d() function used by the Rcmdr is in the car >>> package. The Rcmdr 3D scatterplot dialog doesn't provide for suppressing >>> the points, but if you add radius=rep(0, n) to the command that's >>> generated, where you'd replace n with the number of cases in the dataset, >>> that would do the trick by plotting spheres of 0 radius. For example, try >>> >>> scatter3d(prestige ~ income + education, data=Duncan, >>> radius=rep(0, 45), residuals=FALSE) >>> >>> either in the Rcmdr or at the R command prompt. >>> >>> For more information see ?scatter3d or press the Help button in the Rcmdr >>> 3D scatterplot dialog and follow the link to scatter3d. >>> >>> I hope this helps, >>> John >>> >>> ----------------------------- >>> John Fox, Professor >>> McMaster University >>> Hamilton, Ontario >>> Canada L8S 4M4 >>> Web: socserv.mcmaster.ca/jfox >>> >>> >>> >>>> -----Original Message----- >>>> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff >>>> Tostenrude >>>> Sent: October 2, 2015 7:34 PM >>>> To: r-help at r-project.org >>>> Subject: [R] scatter3d >>>> >>>> I am using scatter3d in R Commander to plot a group of regression >>> surfaces. >>>> However, I only want to display the surfaces. How do I remove the points? >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>> 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 at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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. >> > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >
Dear Jeff,> -----Original Message----- > From: Jeff Tostenrude [mailto:climberjeff at gmail.com] > Sent: October 2, 2015 11:46 PM > To: Fox, John <jfox at mcmaster.ca> > Cc: r-help at r-project.org > Subject: Re: [R] scatter3d > > Thank you for the suggestion. Yes, it does seem to be a bit counter-intuitive, but > that is the output I am being asked to produce. I have only been using R for a > few weeks, so there is probably a better way to do it. > > Anyway, your suggestion did work, but only up to 337 data points. I am dealing > with ~100,000 data points so this doesn't really work for me. Is there another > method you would suggest? My goal is to plot multiple regression planes > (without points) in an interactive 3d plot.I don't think that you said in your initial posting that you have so many points. The scatter3d() function in the car package uses functions in the rgl package to draw 3D scatterplots. As Uwe Ligges and Duncan Murdoch have pointed out, you can use the rgl package directly to make your graph. One approach would be to adapt the scatter3d() code, removing the part of the code that plots the points. As Duncan points out, scatter3d(), which was initially written a long time ago, uses both older rgl.*() functions and newer, and in a sense better-behaved, *3d() functions in the rgl package, which isn't recommended. Because scatter3d() works properly, I haven't changed that (maybe I should). If you write your own function or script, you can take Duncan's advice and use only the *3d() functions. Best, John> > Thank you, > Jeff > > On Fri, Oct 2, 2015 at 5:22 PM, Fox, John <jfox at mcmaster.ca > <mailto:jfox at mcmaster.ca> > wrote: > > > Dear Jeff, > > I'm tempted to say that a scatterplot without points is an oxymoron, but > that wouldn't be very helpful. > > Actually, the scatter3d() function used by the Rcmdr is in the car > package. The Rcmdr 3D scatterplot dialog doesn't provide for suppressing the > points, but if you add radius=rep(0, n) to the command that's generated, where > you'd replace n with the number of cases in the dataset, that would do the trick > by plotting spheres of 0 radius. For example, try > > scatter3d(prestige ~ income + education, data=Duncan, > radius=rep(0, 45), residuals=FALSE) > > either in the Rcmdr or at the R command prompt. > > For more information see ?scatter3d or press the Help button in the > Rcmdr 3D scatterplot dialog and follow the link to scatter3d. > > I hope this helps, > John > > ----------------------------- > John Fox, Professor > McMaster University > Hamilton, Ontario > Canada L8S 4M4 > Web: socserv.mcmaster.ca/jfox <http://socserv.mcmaster.ca/jfox> > > > > > > -----Original Message----- > > From: R-help [mailto:r-help-bounces at r-project.org <mailto:r-help- > bounces at r-project.org> ] On Behalf Of Jeff > > Tostenrude > > Sent: October 2, 2015 7:34 PM > > To: r-help at r-project.org <mailto:r-help at r-project.org> > > Subject: [R] scatter3d > > > > I am using scatter3d in R Commander to plot a group of regression > surfaces. > > However, I only want to display the surfaces. How do I remove the > points? > > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org <mailto:R-help at r-project.org> mailing list -- To > UNSUBSCRIBE and more, see > > 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. > >
Thank you for the advice, I will try you suggestions on Monday. Uwe, by interactive I just mean the ability to spin the plot. On Sat, Oct 3, 2015 at 7:07 AM, Fox, John <jfox at mcmaster.ca> wrote:> Dear Jeff, > > > -----Original Message----- > > From: Jeff Tostenrude [mailto:climberjeff at gmail.com] > > Sent: October 2, 2015 11:46 PM > > To: Fox, John <jfox at mcmaster.ca> > > Cc: r-help at r-project.org > > Subject: Re: [R] scatter3d > > > > Thank you for the suggestion. Yes, it does seem to be a bit > counter-intuitive, but > > that is the output I am being asked to produce. I have only been using R > for a > > few weeks, so there is probably a better way to do it. > > > > Anyway, your suggestion did work, but only up to 337 data points. I am > dealing > > with ~100,000 data points so this doesn't really work for me. Is there > another > > method you would suggest? My goal is to plot multiple regression planes > > (without points) in an interactive 3d plot. > > I don't think that you said in your initial posting that you have so many > points. > > The scatter3d() function in the car package uses functions in the rgl > package to draw 3D scatterplots. As Uwe Ligges and Duncan Murdoch have > pointed out, you can use the rgl package directly to make your graph. One > approach would be to adapt the scatter3d() code, removing the part of the > code that plots the points. > > As Duncan points out, scatter3d(), which was initially written a long time > ago, uses both older rgl.*() functions and newer, and in a sense > better-behaved, *3d() functions in the rgl package, which isn't > recommended. Because scatter3d() works properly, I haven't changed that > (maybe I should). If you write your own function or script, you can take > Duncan's advice and use only the *3d() functions. > > Best, > John > > > > > Thank you, > > Jeff > > > > On Fri, Oct 2, 2015 at 5:22 PM, Fox, John <jfox at mcmaster.ca > > <mailto:jfox at mcmaster.ca> > wrote: > > > > > > Dear Jeff, > > > > I'm tempted to say that a scatterplot without points is an > oxymoron, but > > that wouldn't be very helpful. > > > > Actually, the scatter3d() function used by the Rcmdr is in the car > > package. The Rcmdr 3D scatterplot dialog doesn't provide for suppressing > the > > points, but if you add radius=rep(0, n) to the command that's generated, > where > > you'd replace n with the number of cases in the dataset, that would do > the trick > > by plotting spheres of 0 radius. For example, try > > > > scatter3d(prestige ~ income + education, data=Duncan, > > radius=rep(0, 45), residuals=FALSE) > > > > either in the Rcmdr or at the R command prompt. > > > > For more information see ?scatter3d or press the Help button in the > > Rcmdr 3D scatterplot dialog and follow the link to scatter3d. > > > > I hope this helps, > > John > > > > ----------------------------- > > John Fox, Professor > > McMaster University > > Hamilton, Ontario > > Canada L8S 4M4 > > Web: socserv.mcmaster.ca/jfox <http://socserv.mcmaster.ca/jfox> > > > > > > > > > > > -----Original Message----- > > > From: R-help [mailto:r-help-bounces at r-project.org <mailto: > r-help- > > bounces at r-project.org> ] On Behalf Of Jeff > > > Tostenrude > > > Sent: October 2, 2015 7:34 PM > > > To: r-help at r-project.org <mailto:r-help at r-project.org> > > > Subject: [R] scatter3d > > > > > > I am using scatter3d in R Commander to plot a group of regression > > surfaces. > > > However, I only want to display the surfaces. How do I remove the > > points? > > > > > > > > [[alternative HTML version deleted]] > > > > > > ______________________________________________ > > > R-help at r-project.org <mailto:R-help at r-project.org> mailing > list -- To > > UNSUBSCRIBE and more, see > > > 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]]