[R-sig-eco] extract beta.sim from dist type data (package betapart)

Sarah Goslee sarah.goslee at gmail.com
Wed Jul 17 16:19:41 CEST 2013


Hi Elaine.

Please do not cross-post to multiple help lists. Please do include a
reproducible example.

The help for beta.pair says that it returns a list, so you can extract
the component you're interested in from that list in the usual way. If
you don't know what the usual way is, then you should definitely read
an Introduction to R or some other basic materials.

Using data provided with the package:


data(ceram.s)
ceram.dist <- beta.pair(ceram.s, index.family="sor")
class(ceram.dist)
names(ceram.dist)
ceram.sim <- ceram.dist[["beta.sim"]]
class(ceram.sim)


Sarah

On Wed, Jul 17, 2013 at 5:50 AM, Elaine Kuo <elaine.kuo.tw at gmail.com> wrote:
> Dear List,
>
> This is Elaine.
> I am using beta.part to calculate the beta diversity index.
> The function of beta.part can generate three kinds of beta diversity indice
> at one time.
> However, it is Simpson index that I want.
>
> The calculation result is composed of three rows and N/A columns (dist
> class).
> I do not know how to extract one of the indice in the form of dist class.
> No relevant example is found the manual.
> (I tried as.vector as below but failed.)
>
> Please kindly help and thank you in advance.
>
> Elaine
>
> Code
>  library(betapart)
>   dist.sim<-beta.pair(dataR, index.family="sor")
>
> # Unfold distance matrices into vectors
>   data.sim<-data.frame(as.vector(dist.sim))
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-sig-ecology mailing list