accumulation curve in R

后端 未结 2 1415
一个人的身影
一个人的身影 2021-01-06 14:43

I have data of species at 4 sites over several months. I have successfully created accumulation graphs using package vegan in R but I would like to plot all 4

2条回答
  •  孤街浪徒
    2021-01-06 15:08

    You can just use the add=T argument in plot.specaccum(...)

    library(vegan)
    data(BCI) 
    df <- lapply(c(1,21,41,61,81),function(i)specaccum(BCI[,seq(i,i+19)], method="random"))
    plot(df[[1]])
    for (i in 2:5) plot(df[[i]],add=T, col=i)
    

    This code snippet just loads the built-in BSI dataset in vegan, and creates a list of 5specaccum objects by running specaccum(...) on a subset of the columns in BCI. You don't need to to this since you already have the specaccum objects.

    Then, we create the first plot, and add each new curve with add=T.

提交回复
热议问题