[R-sig-eco] point color in NMDS (vegan)

Gavin Simpson ucfagls at gmail.com
Mon Aug 19 18:08:21 CEST 2013


I have some posts on my blog that explain how to do this, ain the vein
of Vit's reply (indexing via a factor). This way is preferable to that
of Jim's brute-force way, but might seem somewhat magical if you
aren't familiar with indexing rules and how factors are handled.

Anyway, here is the link to the blog post with working examples:

http://www.fromthebottomoftheheap.net/2012/04/11/customising-vegans-ordination-plots/

Anjoy,

G

On 18 August 2013 17:02, Elaine Kuo <elaine.kuo.tw at gmail.com> wrote:
> Dear List,
>
>
>
> This is Elaine.
>
> I am using metaMDS in package vegan to plot NMDS.
>
> However, I want to draw the points using different colors according to
> island sites.
>
> For example:
>
> island site 1: island B, C, D => blue
>
> island site 2: island A, E, F => green
>
> island site 3: island G, H, J => red
>
>
>
> Please kindly advise how to modify the following code to classify the sites
> by colors.
>
> Thank you
>
>
>
> Elaine
>
>
>
> library(MASS)
>
>   library(vegan)
>
>   island.NMDS  <-  metaMDS(island,k=2, distfun  =  betadiver,  distance  =
> "sim",trymax=100,zerodist="add")
>
>   plot(island.NMDS,  type  =  "n")
>
>
>
>   # species as symbols
>
>   points(island.NMDS, display = 'species', pch = '+', cex = 0.6)
>
>
>
>   # sites as text
>
>   text(island.NMDS, display = 'sites')
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



-- 
Gavin Simpson, PhD



More information about the R-sig-ecology mailing list