leannehaggerty
2012-Mar-22 17:15 UTC
[R] How do you distinguish between characters on a pco plot?
I have a presence/absence matrix for which I create a distance matrix and then perform pco analysis on. /library(ecodist) table <- read.table("matrix.pa") dist <- dist(table, method = "euclidean", diag = FALSE, upper = FALSE) dist.pco <- pco(dist)/ When I plot the pco analysis of the distance matrix I want to be able to distinguish between certain characters, for example if the distance matrix looks like: http://r.789695.n4.nabble.com/file/n4496217/Screen_shot_2012-03-22_at_17.14.17.png 1, 2, 3 and 4 are the characters to be plotted. I'd like 1 and 2 to appear as the same shape/ colour on the plot, different from 3 and 4. Is it possible to do this? -- View this message in context: http://r.789695.n4.nabble.com/How-do-you-distinguish-between-characters-on-a-pco-plot-tp4496217p4496217.html Sent from the R help mailing list archive at Nabble.com.
Sarah Goslee
2012-Mar-22 21:18 UTC
[R] How do you distinguish between characters on a pco plot?
Hi, You can use eg pch and col in the plot command (see ?par for information). The help for pco even gives an example of doing so. Sarah On Thu, Mar 22, 2012 at 1:15 PM, leannehaggerty <leannehaggerty at gmail.com> wrote:> I have a presence/absence matrix for which I create a distance matrix and > then perform pco analysis on. > > /library(ecodist) > table <- read.table("matrix.pa") > dist <- dist(table, method = "euclidean", diag = FALSE, upper = FALSE) > dist.pco <- pco(dist)/ > > When I plot the pco analysis of the distance matrix I want to be able to > distinguish between certain characters, for example if the distance matrix > looks like: > > http://r.789695.n4.nabble.com/file/n4496217/Screen_shot_2012-03-22_at_17.14.17.png > > 1, 2, 3 and 4 are the characters to be plotted. I'd like 1 and 2 to appear > as the same shape/ colour on the plot, different from 3 and 4. Is it > possible to do this? >-- Sarah Goslee http://www.functionaldiversity.org
Reasonably Related Threads
- Problem getting quota-warning script to function.
- File format for single channel analysis of Agilent microarray data in Limma?
- distance coefficient for amatrix with ngative valus
- Problem getting quota-warning script to function.
- how to add 3d-points to bplot {rms} figure?