top of page

Poncho R function now available on github

Updated: Oct 30, 2020

The Poncho R function, used to plot community data along environmental gradients, as demonstrated below, is now available on github.

To use the function the user can:

1) execute the following command in R:

source("https://raw.githubusercontent.com/csdambros/R-functions/master/poncho.R")

and then use the function:

poncho (matrix)

where matrix is a matrix of species presence/absence or abundance with species as columns and sites as rows.

2) Access https://raw.githubusercontent.com/csdambros/R-functions/master/poncho.R from a web browser

Right-click the file to save the script as "poncho.R"

Open R in the same folder where the file is (or move the file to the working directory folder)

Source the file using:

source("poncho.R")

and then use the function:

poncho (matrix)

Where matrix is a matrix of species presence/absence or abundance with species as columns and sites as rows.

By default, the function does not use species phylogenetic information or the environmental gradient, however, the user can easily incorporate this information by including the env and phy arguments:

poncho (matrix,env = env,phy = phy)

Where env is a vector with a value for each site (the length of this vector must match the number of rows in matrix) and phy is a phylogeny (tip names must match the name of the columns in matrix; i.e. all species in the data must be in the phylogeny).

A script showing how to use the poncho function to generate a figure similar to the one shown on the top of this page (with a phylogeny) is avaliable at (comments in Portuguese only):

How to cite

The function can be cited using the Digital Object Identifier (DOI):

10.5281/zenodo.3784397

Dambros, C.S. (2020) csdambros/R-functions: First release. [https://github.com/csdambros/R-functions/tree/v1.0]

232 views0 comments

Recent Posts

See All
bottom of page