sites_by_species {ALA4R}R Documentation

Sites by species

Description

A data.frame is returned as grid cells by species with values in each cell being the number of occurrences of each species. No null (all zero) species should be returned. The coordinates returned are the TOP-LEFT corner of the grid cell.

Usage

sites_by_species(taxon, wkt, gridsize = 0.1, SPdata.frame = FALSE,
  verbose = ala_config()$verbose)

Arguments

taxon

string: the identifier to get the species data from the ala biocache. E.g. "genus:Macropus".

wkt

string: Bounding area in Well Known Text (WKT) format. E.g. "POLYGON((118 -30,146 -30,146 -11,118 -11,118 -30))".

gridsize

numeric: size of output grid cells in decimal degrees. E.g. 0.1 (=~10km)

SPdata.frame

logical: should the output be returned as a SpatialPointsDataFrame of the sp package?

verbose

logical: show additional progress information? [default is set by ala_config()]

Value

A dataframe or a SpatialPointsDataFrame containing the species by sites data. Columns will include longitude, latitude, and each species present. Values for species are record counts (i.e. number of recorded occurrences of that taxon in each grid cell)

Author(s)

Atlas of Living Australia support@ala.org.au

References

http://api.ala.org.au/ws

http://spatial.ala.org.au/ws

http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html

Examples

## Not run: 
# Eucalyptus in Tasmania based on a 0.1 degree grid
ss=sites_by_species(taxon='genus:Eucalyptus',wkt='POLYGON((144 -43,148 -43,148 -40,144 -40,144 -43))',gridsize=0.1,verbose=TRUE)
ss[,1:6]
# equivalent direct webservice call: POST http://spatial.ala.org.au/alaspatial/ws/sitesbyspecies?speciesq=genus:Eucalyptus&qname=data&area=POLYGON((144%20-43,148%20-43,148%20-40,144%20-40,144%20-43))&bs=http://biocache.ala.org.au/ws/&movingaveragesize=1&gridsize=0.1&sitesbyspecies=1

## End(Not run)

[Package ALA4R version 1.01 Index]