[R] Plotting separate populations in scatterplot3d

From: Eleca Dunham <ejd162_at_psu.edu>
Date: Tue, 06 May 2008 13:40:36 -0400


Hi,

I'm having trouble plotting populations as separate colors and points in the 3d scatterplot package. I have a column with 4 different population names and 3 columns with my data. I want to plot each population with a different color and pch. In addition, I want to use the type="h" in my plotting so that I can see the points clearly in my graph( for publication purposes). I've also attached an example dataset.

I simply want to show that each population clusters separately in space.

I've attached a visual representation of what I want my data to look like. The scripts for this graph is as follows:

data(trees)
s3d <- scatterplot3d(trees, type = "h", color = "blue", angle = 55, scale.y = 0.7, pch = 16, main = "Adding elements")

For some reason, R will not read my header, so I had to use the data.frame function to get R to read my data. This is a real pain because I have tons of data. I've tried the following to get R to recognize each population type separately:

PopulationType.LK1<-PopulationType[LK1]
PopulationType.LK2<-PopulationType[LK2].... points((PopulationType.LK1, col="red", pch=19), (PopulationType.LK2, col="blue", pch=22), .....)

When I tweak the example tree code from above, R will plot all of my data no problem (with the rgl 3d graphs, not scatterplot3d), but only with one color and plotting character. It seems pretty straightforward, but I've spent 4 days on this already.

Any help would be greatly appreciated.

Regards,
EJ



R-help_at_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. Received on Tue 06 May 2008 - 18:11:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 06 May 2008 - 18:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive