Learn R Programming

ecospat (version 4.1.1)

ecospat.nicheNBmean: Niche position and niche breadth)

Description

ecospat.nicheNBmean calculates the weighted mean niche breadth accross several axes from a nichePOSNB object.

Usage

ecospat.nicheNBmean(POSNB,w)

Value

The function returns a 1 column dataframe with the weighted mean niche breadth for each taxa.

Arguments

POSNB

an object created by the function ecospat.nichePOSNB

w

a vector with a weight for each environmental axes.

Author

Lucie Malard lucie.malard@unil.ch and Olivier Broennimann olivier.broennimann@unil.ch

Details

The function calculates the weighted mean niche breadth. The weights w are rescaled so that their sum equals 1.

References

L.A. Malard, H.K. Mod, N. Guex, O. Broennimann, E. Yashiro, E. Lara, E.D.A. Mitchell, H. Niculita-Hirzel & A. Guisan. The ecological niche of soil bacterial, archaeal, fungal and protist communities along environmental gradients in the Alps. 2021. Accepted in Soil Biology and Biochemistry.

Examples

Run this code

data(ecospat.testNichePOSNB)
df<-ecospat.testNichePOSNB

# 1 axes
POSNB<-ecospat.nichePOSNB(df,colvar=c(2),colfreq = 6:17) 

# 2 axes
POSNB<-ecospat.nichePOSNB(df,colvar=c(2:3),colfreq = 6:17) 
ecospat.nicheNBmean(POSNB,w=c(2,1))

# 4 axes
POSNB<-ecospat.nichePOSNB(df,colvar=c(2:5),colfreq = 6:17) 
ecospat.nicheNBmean(POSNB,w=c(1,0.8,0.2,0.1))

Run the code above in your browser using DataLab