Skip to contents

Phylogenetic Diversity

Functions to calculate alpha and beta phylogenetic diversity

psv() psr() pse() psc() psv.spp() psd()
Phylogenetic Species Diversity Metrics
pcd()
pairwise site phylogenetic community dissimilarity (PCD) within a community
pcd_pred()
Predicted PCD with species pool

Phylogenetic Correlations

Functions to calculate correlations while accounting for phylogenetic relationships.

cor_phylo() boot_ci(<cor_phylo>) print(<cor_phylo>)
Correlations among multiple variates with phylogenetic signal
boot_ci()
Generic method to output bootstrap confidence intervals from an object.
refit_boots() print(<cp_refits>)
Refit bootstrap replicates that failed to converge in a call to cor_phylo

Phylogenetic Generalized Linear Mixed Models

Functions to fit PGLMMs.

pglmm_matrix_structure()
pglmm_matrix_structure produces the entire covariance matrix structure (V) when you specify random effects.
pglmm_plot_ranef() pglmm_plot_re()
Visualize random terms of communityPGLMMs
pglmm_predicted_values()
Predicted values of PGLMM
pglmm_profile_LRT()
Testing statistical significance of random effect
pglmm()
Phylogenetic Generalized Linear Mixed Model for Community Data
pglmm_boot_LRT()
Parametric bootstrap likelihood ratio test of nested models
pglmm_compare() predict(<pglmm_compare>)
Phylogenetic Generalized Linear Mixed Model for Comparative Data
pglmm_iV()
Inverse of the covariance matrix of a fitted PGLMM
pglmm_is_singular()
Is a fitted PGLMM at the boundary (singular)?
prep_dat_pglmm()
Prepare data for pglmm
print(<pglmm_compare>)
Print summary information of fitted model
ranef(<communityPGLMM>) print(<ranef.pglmm>)
Extract group-level estimates of random effects
summary(<pglmm_compare>) print(<summary.pglmm_compare>)
Summary information of fitted pglmm_compare model
VarCorr(<communityPGLMM>)
Extract variances of random terms
anova(<communityPGLMM>)
Likelihood ratio tests of nested models
coef(<communityPGLMM>) df.residual(<communityPGLMM>)
Fixed effects of a fitted pglmm
confint(<communityPGLMM>)
Confidence intervals for the parameters of a fitted pglmm
family(<communityPGLMM>)
Family Objects for communityPGLMM objects
fitted(<communityPGLMM>)
Fitted values for communityPGLMM
fixef(<communityPGLMM>)
Extract fixed-effects estimates
formula(<communityPGLMM>)
Formula of a fitted pglmm
logLik(<communityPGLMM>)
Log-likelihood of a communityPGLMM Model
model.frame(<communityPGLMM>)
Extracting the Model Frame from a communityPGLMM Model object
nobs(<communityPGLMM>)
Number of Observation in a communityPGLMM Model
plot_data() plot_bayes(<communityPGLMM>)
Plot the original dataset and predicted values (optional)
terms(<communityPGLMM>) model.matrix(<communityPGLMM>)
Terms and model matrix of the fixed effects of a PGLMM
predict(<communityPGLMM>)
Predict Function for communityPGLMM Model Objects
print(<communityPGLMM>)
Print summary information of fitted model
residuals(<communityPGLMM>)
Residuals of communityPGLMM objects
simulate(<communityPGLMM>)
Simulate from a communityPGLMM object
summary(<communityPGLMM>) print(<summary.communityPGLMM>)
Summary information of fitted model
tidy(<communityPGLMM>) glance(<communityPGLMM>)
Tidy and glance methods for pglmm fits
vcov(<communityPGLMM>)
Covariance matrix of the fixed effects
get_design_matrix()
get_design_matrix gets design matrix for gaussian, binomial, and poisson models
plot_bayes()
plot_bayes generic

Phylogenetic Signal

Pagel’s lambda and Blomberg’s K, with known measurement error, in linear time.

phylo_signal()
Phylogenetic signal with known measurement error

Helper Functions

Functions to help with data processing.

vcv2()
Create phylogenetic var-cov matrix
rm_site_noobs()
Remove site that has no observations of any species
rm_sp_noobs()
Remove species that not observed in any site
`%nin%`
Not in
align_comm_V()
Create phylogenetic var-cov matrix based on phylogeny and community data
match_comm_tree()
Match phylogeny with community data

Data Sets

Examplary data sets used in the package

comm_a
Example community data
comm_b
Example community data
traits
Example species traits data
phylotree
Example phylogeny
envi
Example environmental data
oldfield
Phylogeny and community data from an Oldfield ecosystem in Southern Ontario, Canada