[R] plotting vector of symbols

stephen sefick ssefick at gmail.com
Wed Sep 2 20:36:46 CEST 2009


I did something very similar in ggplot2 about a year ago.  Use the
unique sampling location from the species count data (rownames) as a
factor column, and then use that in a geom_color or geom_shape add on
to qplot

untested:

library ggplot2
a <- metaMDS(foo, k=3)
b <- rownames(foo)
d <- data.frame(b , a$points)
qplot(axis_1, axis_2, data=d, colour="b")

something like this may work - it would be nice to have a reproducible example

Stephen

On Wed, Sep 2, 2009 at 1:11 PM, Wade Wall<wade.wall at gmail.com> wrote:
> Hi all,
>
> Is there a way in R to plot points using symbols as defined in another
> vector without adding a separate points line for each symbol?  For
> example, I have the results from an ordination with ~ 35 points and an
> associated vector that corresponds to different symbols in pch for the
> 35 symbols.  I would like to write one line, rather than dividing up
> the 35 points into categories first, but I can't see to find a way.
> Basically, I am trying to do this . . . .
>
> points(ordination$points, pch=popsymbols[,2]), where popsymbols[,2] is
> a column of symbol values.
>
> Thanks for any help,
>
> Wade Wall
>
> ______________________________________________
> 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.
>



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




More information about the R-help mailing list