Forgive me please if this has been answered previously, but the r-help archive doesn't have a "search" capability. It's a pity, as I'm sure that there's a wealth of informative help in there. I am unable to get the "cloud" function to produce a fundamental 3D scatterplot. I have a 3-column numeric matrix:>is.matrix(sanity.MIF); is.numeric(sanity.MIF); dim(sanity.MIF); >cloud(sanity.MIF)[1] TRUE [1] TRUE [1] 2970 3>A blank grey graphics window is opened, but no vestige of a plot or labels of any kind. Can someone tell me what I am missing please? R 1.7.1 Windows2000 is new to me, but plenty of prior S-Plus Unix experience, including the use of the "spin" function for rotational 3D scatterplots. Thank You for your help.
Actually, there IS a search facility, although you have to look for it. A search on "cloud" returned 5 pages. If you type ?cloud, you can see that you need to provide a formula as well as a dataset. So if your variables are x,y,z in dataframe dat, then cloud(z~x*y, data=dat) should work. Cheers, Simon. Simon Blomberg, PhD Depression & Anxiety Consumer Research Unit Centre for Mental Health Research Australian National University http://www.anu.edu.au/cmhr/ Simon.Blomberg at anu.edu.au +61 (2) 6125 3379> -----Original Message----- > From: Tony Ross [mailto:ynotssor at hotmail.com] > Sent: Monday, 23 June 2003 4:09 PM > To: r-help at stat.math.ethz.ch > Subject: [R] "cloud" function doesn't plot > > > Forgive me please if this has been answered previously, but > the r-help > archive doesn't have a "search" capability. It's a pity, as > I'm sure that > there's a wealth of informative help in there. > > I am unable to get the "cloud" function to produce a fundamental 3D > scatterplot. I have a 3-column numeric matrix: > > >is.matrix(sanity.MIF); is.numeric(sanity.MIF); dim(sanity.MIF); > >cloud(sanity.MIF) > [1] TRUE > [1] TRUE > [1] 2970 3 > > > > A blank grey graphics window is opened, but no vestige of a > plot or labels > of any kind. > > Can someone tell me what I am missing please? R 1.7.1 > Windows2000 is new to > me, but plenty of prior S-Plus Unix experience, including the > use of the > "spin" function for rotational 3D scatterplots. > > Thank You for your help. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
>From: "Simon Blomberg" <Simon.Blomberg at anu.edu.au> >Date: Mon, 23 Jun 2003 16:26:39 +1000>If you type ?cloud, you can see that you need to provide a formula as well >as a dataset. So if your variables are x,y,z in dataframe dat, then >cloud(z~x*y, data=dat) should work.[...]>>is.matrix(sanity.MIF); is.numeric(sanity.MIF); dim(sanity.MIF); >>cloud(sanity.MIF) >[1] TRUE >[1] TRUE >[1] 2970 3 >>The "help(cloud)" facility states: "`formula' can be a matrix". As I stated, I have a 3-column numeric matrix, so colum 3 should be plotted as a point above the 1st and 2nd column co-ordinates. No plot is produced however, just a blank graphics device. Thanks.
>From: Uwe Ligges <ligges at statistik.uni-dortmund.de> >Date: Mon, 23 Jun 2003 08:58:38 +0200>It states completely: >"As an extension to partially support the form used in filled.contour and >image, formula can be a matrix." >Thus, see ?image that you don't need a 3 column matrix, but a matrix >containing the z values. > >I'd suggest to convert the matrix to a data.frame and follow the suggestion >from Simon Blomberg.Thank you, I didn't properly appreciate the need for a data.frame. The cloud() now plots as expected. Thank You everyone.