species accumulation curve with percentages

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

species accumulation curve with percentages

goloszi
I need to express species accumulation curve in percentage terms, i.e. the
vertical axis is from 1% to 100%
I have community data similar to BCI (from vegan package).
I can construct the 'usual' species curve (see below) but I need to convert
the species number to percentage.

data("BCI")
bcispec<-specaccum(BCI, method = "random",
                   permutations = 100)
plot(bcispec)

--
Eddie Tsyrlin, PhD Candidate | PEARG | Building 404, Grd Floor, Rm G21

School of Biosciences | University of Melbourne
*Post:* Bio21,  Flemington Rd, Parkville VIC 3052
*m: *0413 995525

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.

Rplot05.png (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: species accumulation curve with percentages

Bert Gunter-2
Probably: ?sum  ?cumsum

e.g.
> x <- runif(100, 10,20)
> cumsum(x)/sum(x) *100

Cheers,
Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Jun 16, 2020 at 8:15 AM Eddie Tsyrlin <
[hidden email]> wrote:

> I need to express species accumulation curve in percentage terms, i.e. the
> vertical axis is from 1% to 100%
> I have community data similar to BCI (from vegan package).
> I can construct the 'usual' species curve (see below) but I need to convert
> the species number to percentage.
>
> data("BCI")
> bcispec<-specaccum(BCI, method = "random",
>                    permutations = 100)
> plot(bcispec)
>
> --
> Eddie Tsyrlin, PhD Candidate | PEARG | Building 404, Grd Floor, Rm G21
>
> School of Biosciences | University of Melbourne
> *Post:* Bio21,  Flemington Rd, Parkville VIC 3052
> *m: *0413 995525
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: species accumulation curve with percentages

Jim Lemon-4
In reply to this post by goloszi
Hi Eddie,
I don't have the vegan package, but this may help:

accum<-function(x,y) return(x+(y-x)/7)
nspec<-90
for(i in 2:50) nspec[i]<-accum(nspec[i-1],220)
plot(nspec/nspec[1]*100,type="l",xlab="Sites",
 ylab="Species accumulation (%)")

Jim

On Wed, Jun 17, 2020 at 1:15 AM Eddie Tsyrlin
<[hidden email]> wrote:

>
> I need to express species accumulation curve in percentage terms, i.e. the
> vertical axis is from 1% to 100%
> I have community data similar to BCI (from vegan package).
> I can construct the 'usual' species curve (see below) but I need to convert
> the species number to percentage.
>
> data("BCI")
> bcispec<-specaccum(BCI, method = "random",
>                    permutations = 100)
> plot(bcispec)
>
> --
> Eddie Tsyrlin, PhD Candidate | PEARG | Building 404, Grd Floor, Rm G21
>
> School of Biosciences | University of Melbourne
> *Post:* Bio21,  Flemington Rd, Parkville VIC 3052
> *m: *0413 995525
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: species accumulation curve with percentages

Jim Lemon-4
Hi Eddie,
Upon reading your initial request more carefully, the last command should be:

plot(nspec/nspec[50]*100,type="l",xlab="Sites",
 ylab="Species accumulation (%)",ylim=c(1,100))

Jim

On Wed, Jun 17, 2020 at 8:23 AM Jim Lemon <[hidden email]> wrote:

>
> Hi Eddie,
> I don't have the vegan package, but this may help:
>
> accum<-function(x,y) return(x+(y-x)/7)
> nspec<-90
> for(i in 2:50) nspec[i]<-accum(nspec[i-1],220)
> plot(nspec/nspec[1]*100,type="l",xlab="Sites",
>  ylab="Species accumulation (%)")
>
> Jim
>
> On Wed, Jun 17, 2020 at 1:15 AM Eddie Tsyrlin
> <[hidden email]> wrote:
> >
> > I need to express species accumulation curve in percentage terms, i.e. the
> > vertical axis is from 1% to 100%
> > I have community data similar to BCI (from vegan package).
> > I can construct the 'usual' species curve (see below) but I need to convert
> > the species number to percentage.
> >
> > data("BCI")
> > bcispec<-specaccum(BCI, method = "random",
> >                    permutations = 100)
> > plot(bcispec)
> >
> > --
> > Eddie Tsyrlin, PhD Candidate | PEARG | Building 404, Grd Floor, Rm G21
> >
> > School of Biosciences | University of Melbourne
> > *Post:* Bio21,  Flemington Rd, Parkville VIC 3052
> > *m: *0413 995525
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.