Description Usage Arguments Value
View source: R/dsp_create_from_survey.R
Reads a data frame or a matrix of local site-species abundances, with rows being sites and columns being species, along with GIS data files for each of the species (may be more too) ocurring in the local data matrix. The function produces a dispersion field of the regional presence pattern for each site in a user-specified latitudinal and longitudinal range.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dsp_create_from_survey(
local_data,
gis_data_type = "shp",
shp_dir = NULL,
gdb_dir = NULL,
gdb_object = NULL,
gdb_layer = "All_Species",
gdb_species_feature = "SCINAME",
raster_latlim = c(5, 50),
raster_longlim = c(50, 120),
raster_resolution = 1,
precision = 0.05,
base_local = 0,
quiet = T,
optional_species_names = NULL,
include_shp_attributes = "x$SEASONAL==1 | x$SEASONAL==2"
)
|
local_data |
abundance site (row) x species (column) matrix/data frame. |
gis_data_type |
One of c("shp","gdb"). Are the GIS data in seperate shapefiles or in a geodatabase file? |
shp_dir |
The directory that contains shapefiles for all the species in the local data matrix. |
gdb_dir |
The directory that contains the geodatabase. |
gdb_object |
The geodatabase can be read in ahead of time and provided as an sf object. This will dramatically reduce run time, especially useful if the function is to be run multiple times. |
gdb_layer |
If layer name of the gdb file that contains the species distributions. |
gdb_species_feature |
The name of the feature that contains the species names in the geodatabse. |
raster_latlim |
The latitudinal range of the desired dispersion field. |
raster_longlim |
The longitudinal range of the desired dispersion field. |
raster_resolution |
The precision of the initial estimation provided to fasterize. fasterize tends to undercount small species ranges, so is required to keep at a low value in order detect species presence in a square degree cell. Most users will not need to change, but increaseing this value will speed up the function but with potential for error. |
base_local |
If the count of a species in a local site is less than base_local, it is assumed to be absent from the site. The default is 0. Non zero values may result from obsrvational or data recording errors |
optional_species_names |
If the column name corresponding to some species does not match with the GIS data, the user might need to replace it by another species name. In such a scenario, instead of using column names, the user can enter a new vector of names, which may be slight modification on the species from the column of the data, taking account of issues with non-matching species names between shape files and the local data frame. |
include_shp_attributes |
Each species range may be divided according to a number of attributes, e.g. breeding and non breeding layers, and building dispersion fields may require only a subset of these attributes. The user can provide a string of attributes in order to build the dispersion field based only on those species attributes. The vector must be in a format that is read in by sf and must include an "x" in place of where the sf object will be manipulated in the function. Default includes breeding and resident ranges for global birds based on reading GIS data from BirdLife International. |
Returns 3 lists. In each list, each element is a dispersion field corresponding to the species present in the specific site to which it corresponds. The first list "matrix" contains each dispersion field as a matrix. The second list "raster" returns each dispersion field as a raster. The third list "precise" returns each dispersion field at the high resolution of precision. The names of the elements of each list are assigned as the row names of the input data matrix (sites).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.