Re: [R] selecting points on 3D scatterplots

2009-05-15 Thread John Fox
Dear list members,

I was out of town when this message arrived and so didn't respond at the
time. I did respond to a private email from the poster.

Yes, the scatter3d() function in the Rcmdr package can identify points in 3D
scatterplots drawn with rgl via the identify3d() function in the same
package. Points are identified by right-clicking and dragging. The nice()
function is in the car package, one of the suggested packages for the
Rcmdr package.

John

-- original message --

It looks like Rcmdr may be able to select points on 3D scatterplots
however when I try to use it's 3dscatter plot function I get the error
message:  could not find function nice

If I copy the code:

scatter3d(data$X, data$Z, data$Y, surface=FALSE, residuals=TRUE, bg=white,
+ axis.scales=TRUE, grid=TRUE, ellipsoid=FALSE, xlab=X, ylab=Z,
zlab=Y)

into the R console I get the same error message. Sorry I'm new - does
anyone know where this missing nice function can be found?


I tried using scatterplot3d but it doesn't rotate or zoom - which I
need to be able to do to select the data... but thanks for the
suggestion!

. . .

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox

__
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.


[R] selecting points on 3D scatterplots

2009-05-12 Thread Abby Drake
Hello Everyone,

I am new to R and need some help.

I have a matrix of x,y,z coordinates that I would like to
interactively plot in 3D and then using the cursor select points on
the plot and have the coordinates sent to a matrix. I am using the rgl
package to plot the data at the moment because it allows me to rotate
and zoom. I also tried cloud and scatterplot3D.

I am looking for a function like 'locator' which is used to select
points on 2D scatterplots.

Thanks in advance!
Abby

__
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.


Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Duncan Murdoch

On 5/12/2009 3:08 PM, Abby Drake wrote:

Hello Everyone,

I am new to R and need some help.

I have a matrix of x,y,z coordinates that I would like to
interactively plot in 3D and then using the cursor select points on
the plot and have the coordinates sent to a matrix. I am using the rgl
package to plot the data at the moment because it allows me to rotate
and zoom. I also tried cloud and scatterplot3D.

I am looking for a function like 'locator' which is used to select
points on 2D scatterplots.


There's no locator3d, but select3d is somewhat similar.

You could write a locator3d function using the rgl.setMouseCallbacks, 
rgl.user2window and rgl.window2user functions, if you can figure out how 
to indicate depth with a mouse click.  identify3d might be a little easier.


Duncan Murdoch

__
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.


Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Uwe Ligges

Or with scatterplot3d:

The regular identify() usage with the iris data:

 s3d - scatterplot3d(iris[,1:3], color=as.numeric(iris[,5]))
 identify(s3d$xyz.convert(iris[,1:3]))

or for locator: the values you get are the 2D representation of the 
current coordinate system and you can use locator directly for putting 
text in such as in:


text(locator(1), The iris data)

If you want to convert back to 3D: This is not possible, because there 
is a while line behind that point you are clicking on 


Best,
Uwe Ligges




Duncan Murdoch wrote:

On 5/12/2009 3:08 PM, Abby Drake wrote:

Hello Everyone,

I am new to R and need some help.

I have a matrix of x,y,z coordinates that I would like to
interactively plot in 3D and then using the cursor select points on
the plot and have the coordinates sent to a matrix. I am using the rgl
package to plot the data at the moment because it allows me to rotate
and zoom. I also tried cloud and scatterplot3D.

I am looking for a function like 'locator' which is used to select
points on 2D scatterplots.


There's no locator3d, but select3d is somewhat similar.

You could write a locator3d function using the rgl.setMouseCallbacks, 
rgl.user2window and rgl.window2user functions, if you can figure out how 
to indicate depth with a mouse click.  identify3d might be a little easier.


Duncan Murdoch

__
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.


__
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.


Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Abby Drake
It looks like Rcmdr may be able to select points on 3D scatterplots
however when I try to use it's 3dscatter plot function I get the error
message:  could not find function nice

If I copy the code:

scatter3d(data$X, data$Z, data$Y, surface=FALSE, residuals=TRUE, bg=white,
+ axis.scales=TRUE, grid=TRUE, ellipsoid=FALSE, xlab=X, ylab=Z, zlab=Y)

into the R console I get the same error message. Sorry I'm new - does
anyone know where this missing nice function can be found?


I tried using scatterplot3d but it doesn't rotate or zoom - which I
need to be able to do to select the data... but thanks for the
suggestion!


2009/5/12 Uwe Ligges lig...@statistik.tu-dortmund.de:
 Or with scatterplot3d:

 The regular identify() usage with the iris data:

  s3d - scatterplot3d(iris[,1:3], color=as.numeric(iris[,5]))
  identify(s3d$xyz.convert(iris[,1:3]))

 or for locator: the values you get are the 2D representation of the current
 coordinate system and you can use locator directly for putting text in such
 as in:

 text(locator(1), The iris data)

 If you want to convert back to 3D: This is not possible, because there is a
 while line behind that point you are clicking on 

 Best,
 Uwe Ligges




 Duncan Murdoch wrote:

 On 5/12/2009 3:08 PM, Abby Drake wrote:

 Hello Everyone,

 I am new to R and need some help.

 I have a matrix of x,y,z coordinates that I would like to
 interactively plot in 3D and then using the cursor select points on
 the plot and have the coordinates sent to a matrix. I am using the rgl
 package to plot the data at the moment because it allows me to rotate
 and zoom. I also tried cloud and scatterplot3D.

 I am looking for a function like 'locator' which is used to select
 points on 2D scatterplots.

 There's no locator3d, but select3d is somewhat similar.

 You could write a locator3d function using the rgl.setMouseCallbacks,
 rgl.user2window and rgl.window2user functions, if you can figure out how to
 indicate depth with a mouse click.  identify3d might be a little easier.

 Duncan Murdoch

 __
 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.


__
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.


Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread stephen sefick
rgl will rotate and zoom, but I don't know if you can select points.

On Tue, May 12, 2009 at 4:35 PM, Abby Drake
abbygracedr...@googlemail.com wrote:
 It looks like Rcmdr may be able to select points on 3D scatterplots
 however when I try to use it's 3dscatter plot function I get the error
 message:  could not find function nice

 If I copy the code:

 scatter3d(data$X, data$Z, data$Y, surface=FALSE, residuals=TRUE, bg=white,
 + axis.scales=TRUE, grid=TRUE, ellipsoid=FALSE, xlab=X, ylab=Z, zlab=Y)

 into the R console I get the same error message. Sorry I'm new - does
 anyone know where this missing nice function can be found?


 I tried using scatterplot3d but it doesn't rotate or zoom - which I
 need to be able to do to select the data... but thanks for the
 suggestion!


 2009/5/12 Uwe Ligges lig...@statistik.tu-dortmund.de:
 Or with scatterplot3d:

 The regular identify() usage with the iris data:

  s3d - scatterplot3d(iris[,1:3], color=as.numeric(iris[,5]))
  identify(s3d$xyz.convert(iris[,1:3]))

 or for locator: the values you get are the 2D representation of the current
 coordinate system and you can use locator directly for putting text in such
 as in:

 text(locator(1), The iris data)

 If you want to convert back to 3D: This is not possible, because there is a
 while line behind that point you are clicking on 

 Best,
 Uwe Ligges




 Duncan Murdoch wrote:

 On 5/12/2009 3:08 PM, Abby Drake wrote:

 Hello Everyone,

 I am new to R and need some help.

 I have a matrix of x,y,z coordinates that I would like to
 interactively plot in 3D and then using the cursor select points on
 the plot and have the coordinates sent to a matrix. I am using the rgl
 package to plot the data at the moment because it allows me to rotate
 and zoom. I also tried cloud and scatterplot3D.

 I am looking for a function like 'locator' which is used to select
 points on 2D scatterplots.

 There's no locator3d, but select3d is somewhat similar.

 You could write a locator3d function using the rgl.setMouseCallbacks,
 rgl.user2window and rgl.window2user functions, if you can figure out how to
 indicate depth with a mouse click.  identify3d might be a little easier.

 Duncan Murdoch

 __
 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.


 __
 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.




-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
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.