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

Gavin Simpson ucfagls at gmail.com
Tue Aug 20 04:50:04 CEST 2013


Yes, look at ?dune.env for what it contains.

G

On 19 August 2013 16:45, Elaine Kuo <elaine.kuo.tw at gmail.com> wrote:
> Hello Gavin,
>
> Thanks for mentioning your blog.
>
> I would like what dune.env is, since it is very important to generate
> different colors.
> Is dune.env different from dune?
> What will the dune.env be in the case of metaMDS instead of rda?
>
> Thank you again
>
> Elaine
>
>
> On Tue, Aug 20, 2013 at 12:08 AM, Gavin Simpson <ucfagls at gmail.com> wrote:
>>
>> 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
>
>



-- 
Gavin Simpson, PhD



More information about the R-sig-ecology mailing list