[R] How do you distinguish between characters on a pco plot?
Sarah Goslee
sarah.goslee at gmail.com
Thu Mar 22 22:18:29 CET 2012
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
More information about the R-help
mailing list