Sperich
Sperich
July 8, 2015
Type Package
Title Auxiliary Functions to Estimate Centers of Biodiversity
Version 1.5-7
Date 2015-07-08
Author Maximilian Lange, Sven Lautenbach, Claudia Raedig
Maintainer Maximilian Lange <maximilian-lange@[Link]>
Description Provides some easy-to-use functions to interpolate species range based on species occur-
rences and to estimate centers of biodiversity.
Depends R (>= 2.13)
Imports sp, rgdal, SDMTools, foreach, methods, grDevices, graphics,
stats, utils
Suggests lattice, RColorBrewer
License GPL (>= 2)
NeedsCompilation no
Repository CRAN
Date/Publication 2015-07-08 [Link]
R topics documented:
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
createHeightmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
createImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
createLandwatermask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
createNonInterpolatedGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
edgeNotValid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
evaluate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1
2 [Link]
exportAsGDAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
getDimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
getDistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
getNarrowEndemics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
getShift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
searchClusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
[Link] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Index 34
Description
This function adds an edge between two points to a grid.
Usage
[Link](grid,point.a, point.b)
Arguments
grid A grid to which the edge should be added.
point.a A point in a grid given by its row and column.
point.b A point in a grid given by its row and column.
Details
This function adds an edge between two points to a grid.
Value
The grid with new edge included.
Author(s)
Maximilian Lange, Sven Lautenbach
adjustment 3
Examples
##initialize data
m <- matrix(0,10,10)
point.a <- c(5,8)
point.b <- c(10,3)
Description
This routine adjusts the weighted species richness for sampling effort.
Usage
adjustment([Link], noninterpolatedgrid, clusterlist)
Arguments
[Link]
The grid that should be adjusted. It contains the result of species richness esti-
mation or cross-validation.
noninterpolatedgrid
A grid containing the species occurrences (could be created via function ’creat-
eNonInterpolatedGrid’).
clusterlist A list of vectors of pixelpositions (created by ’searchClusters’) which are spatial
related.
Details
This routine adjusts the interpolated species richness for sampling effort by incorporating an ad-
ditional weighting factor. Therefor, it needs clusters of pixels of the result grid to find centers of
species richness and to create these weighting factor.
Value
This function returns a grid containing the adjusted species richness information.
Author(s)
Maximilian Lange, Sven Lautenbach
4 createHeightmask
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
##prepare adjustment
noninterpolatedgrid <- createNonInterpolatedGrid([Link],
dimension, shift, resolution=1, [Link]=-1)
clusterlimit <- 100
Description
This function creates a height-mask as a grid based on given dimension and coordinates.
Usage
Arguments
[Link] A dataframe containing the longitude and lattitude of the grid cell location as
’long’ and ’lat’ and the height of the cell as ’height’. If the value of ’[Link]’
is ’NULL’, the returned grid contains 0 as height-information of every cell.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
Details
This routine creates a height-mask as a grid. As Input a dataset with height-information is needed.
The grid will be created with a given dimension.
Value
This function returns a grid which contains the height information of the observed area.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##load data
data([Link])
data([Link])
##create height-matrix
[Link] <- createHeightmask([Link], dimension, shift, resolution=1)
Description
This function creates a levelplot of the result-grid of species range estimation and saves it as a
PNG-File.
Usage
createImage(grid, landwatermask, [Link],
directory, filename, shift,
parts=10, resolution=1)
6 createImage
Arguments
grid The grid that should be plotted. It contains the weighted species richness infor-
mation.
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0.
[Link] The heading of the created image.
directory The directory in which the image should be stored.
filename The filename of the created PNG-File.
shift The geographic coordinates of the origin of the grid.
parts An Integer value determining the number of divisions in the colorkey of the
created image.
resolution The resolution of the grid in (geographical) degree.
Details
This routine creates a levelplot of the weighted species richness information and stores it as a PNG-
File. The package lattice is required.
Value
The return type is boolean. The value is TRUE if the image-creation was successful and FALSE if
the image-creation has failed.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
##create image
createLandwatermask 7
## Not run:
[Link] <- createImage([Link], [Link],
[Link]="Test", directory=getwd(), filename="[Link]",
shift, parts=10, resolution=1)
print([Link])
## End(Not run)
Description
This function creates a land-water-mask as a grid based on given dimension and coordinates.
Usage
Arguments
[Link]
A dataset containing the percentage of land on a cell of a grid. The coor-
dinates of the cell should be given as longitude (named: long) and lattude
(named: lat) and the percentage of land shoud be named landsum. If the value of
’[Link]’ is ’NULL’, a grid containing only land-cells will be created.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
Details
Value
This function returns a grid which contains the land-water information of the observed area. The
value of cells containing land is 0, the value of water-cells is -1.
Author(s)
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
createNonInterpolatedGrid
Create a species occurrences grid with no interpolation
Description
This routine creates a grid containing the species occurrences.
Usage
createNonInterpolatedGrid([Link], dimension,
shift, resolution=1, [Link]=-1)
Arguments
[Link]
A dataset containing all observed species with their ID (named: speciesID) and
the longitude (named: long) and latitude (named: lat) of their occurrence loca-
tion.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
[Link] The vector with the numbers of the species which should be mentioned. If the
first value is -1, all species in the database will be added to the grid.
Details
This routine creates a grid and adds all species mentioned in ’[Link]’ to it.
Value
A grid containing the species occurrences without interpolation.
[Link] 9
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
data([Link])
Description
This function adds the species occurrence data to a new grid with given dimension, shift and reso-
lution.
Usage
[Link]([Link], dimension, shift, resolution=1)
Arguments
[Link]
A dataset containing one species with its ID (named: speciesID) and the longi-
tude (named: long) and latitude (named: lat) of the occurrence locations of that
species.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
10 [Link]
Details
This routine adds the species occurrence data to the grid through adding their location as a point
into it.
Value
This function returns a grid which contains the species occurrence information.
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
Description
This data set gives an example of angiosperm species and their occurrence in southern america.
Usage
[Link]
Format
A dataframe containing the longitude and lattitude of the occurrence location as ’long’ and ’lat’ and
the species ID as ’speciesID’.
[Link] 11
Source
Angiosperm Database
References
Morawetz, W. and Raedig, C. (2007). Angiosperm biodiversity, endemism and conservation in the
Neotropics. Taxon 56:1245-1254.
Description
This data set containes the height of 1 degree grid cells of southern america.
Usage
[Link]
Format
A dataframe containing the longitude and lattitude of the grid cell location as ’long’ and ’lat’ and
the height of the cell as ’height’.
Description
This data set containes the percentage of land/water of 1 degree grid cells of southern america.
Usage
[Link]
Format
A dataframe containing the longitude and lattitude of the grid cell location as ’long’ and ’lat’ and
the percentage of land/water as landsum.
12 edgeNotValid
edgeNotValid Edge-Water-Test
Description
This function checks if an edge would cross a water or mountain surface.
Usage
edgeNotValid(grid,point.a, point.b, landwatermask, upperbound)
Arguments
grid A grid to which the edge should be added if it hits no water or mountain surfaces.
point.a A point in a grid given by its row and column.
point.b A point in a grid given by its row and column.
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0. Additional, height-informations could be added for land surfaces. In this
case, take care of the ’upperbound’ value.
upperbound This value determines the height (based on values in ’landwatermask’) which is
considered to be a barrier for species distribution.
Details
This function checks if an edge would cross a water or mountain surface.
Value
A boolean value which determines if the edge would cross a water or mountain surface.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##load data
data([Link])
data([Link])
##initialize variables
distance <- 5
##create landwatermask
[Link] <- createLandwatermask([Link], dimension, shift)
##create grid
grid <- matrix(0,dimension[1],dimension[2])
##add points
grid <- [Link]([Link], dimension, shift)
##points to list
points <- which(grid > 0)
[Link] <- list()
for (i in 1:length(points)){
[Link][[i]] <- c(ifelse((points[i] %% dimension[1]) == 0, dimension[1],
points[i] %% dimension[1]), ceiling(points[i]/dimension[1]))
}
##Edge-Water-Test
check <- edgeNotValid(grid, [Link][[1]],[Link][[2]],
[Link], 1000)
print(check)
Description
This function evaluates the result grids of species richness estimation.
Usage
evaluate([Link], [Link],
[Link]="Histogramm of species richness",
[Link]="Histogramm of species richness", xmax=400, ymax=1000,
directory=getwd(), filename="[Link]")
Arguments
[Link]
A result grid of species richness estimation. If the value is ’NULL’, the grid is
ignored and only the other grid will be included in the resulting png-file.
[Link]
A result grid of species richness estimation. If the value is ’NULL’, the grid is
ignored and only the other grid will be included in the resulting png-file.
[Link] The title for the histogramm of the first grid (’[Link]’).
14 evaluate
[Link] The title for the histogramm of the second grid (’[Link]’).
xmax The maximum value of the abscissa respectively the maximum number of species
in the grid.
ymax The maximum value of the ordinate respectively the maximum frequency shown
in the histogramm.
directory The directory the png-file is created in.
filename The name of the created png-file.
Details
This routine evaluates the result grids of a species richness estimation (details in Raedig et al. 2010).
It creates one or two histogramms (depending on input) of the species occurrences with additional
information about the total number of species of the grid and other statistic scores. It is possible to
create on png-file for every result grid or to compare two result-grids in one png-file, depending on
how many grids are defined as input.
Value
This function creates a png-file with one or two histogramms (depending on input) and additional
statistic informations.
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
#load data
data([Link])
data([Link])
#create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
#evaluation
## Not run:
evaluate([Link], NULL, [Link]="Histogramm 1")
## End(Not run)
Description
This function exports the result grid as a GDAL grid map.
Usage
exportAsGDAL(grid, shift, resolution, directory=getwd(),
filename="[Link]", drivername="GTiff")
Arguments
grid The grid that should be exported.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
directory The directory in which the file will be created.
filename The name of the created file containing the GDAL grid map.
drivername Determines the format of the resulting GDAL grid map. All available drivers
can be shown by using the command ’gdalDrivers()’.
Details
This routine exports a grid as an GDAL grip map. The package rgdal is required.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##load data
data([Link])
data([Link])
##create landwatermask
16 [Link]
##export
exportAsGDAL([Link], shift, resolution=1,
directory=getwd(), filename="[Link]", drivername="GTiff")
Description
This function extracts the datasets of one species out of a database filled with species and their
occurrence locations.
Usage
[Link]([Link], [Link])
Arguments
[Link]
A dataset containing all observed species with their ID (named: speciesID) and
the longitude (named: long) and latitude (named: lat) of their occurrence loca-
tion.
[Link] The number of the species which should be extracted.
Details
This function extracts the datasets of one species out of a database filled with species (named by
their speciesID) and their occurrence locations mentioned with lattitude (named lat) and longitude
(named long).
Value
This function returns a dataset which contains the species occurrence locations.
Author(s)
Maximilian Lange, Sven Lautenbach
[Link] 17
Examples
##load data
data([Link])
Description
This function fills all bounded areas in a grid.
Usage
[Link](grid, landwatermask)
Arguments
grid A grid in which the areas should be filled. Cells with values greater than zero
represent the bounds, cells with values lower or equal zero will be filled with
value 1 if they are bounded.
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0. Cells with negative values will not be filled.
Details
This function fills all bounded areas in a grid.
Value
The grid with filled areas.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##initialize data
m <- matrix(0,10,10)
m[2:8,2] <- 1
m[2:8,8] <- 1
m[2,2:8] <- 1
m[8,2:8] <- 1
18 [Link]
Description
A function that creates an array of subsamples of a dataset.
Usage
[Link]([Link], fold, [Link])
Arguments
[Link]
The number of occurrences of the species.
fold The number of groups which should be created if the number of occurrences is
greater than [Link].
[Link] The limit below which the subsamples are created for a leave-one-out-cross-
validation instead of a k-fold-cross-validation.
Details
This routine creates subsamples of species occurrences based on the number of occurrences of the
chosen species and the number of groups which should be created. If the number of occurrences of
the chosen species is below the [Link], the groups contain only one member and the fold value
will be ignored. The subsamples can be used for a k-fold or leave-one-out-cross-validation.
Value
This function returns a grid which contains the subsamples.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
subsamples <- [Link](15,3,5)
getDimension 19
getDimension getDimension
Description
This function calculates the dimension of the grid which should be used for a species richness
estimation.
Usage
getDimension([Link], resolution=1)
Arguments
[Link]
A dataset containing all observed species with their ID (named: speciesID) and
the longitude (named: long) and latitude (named: lat) of their occurrence loca-
tion.
resolution The resolution of the grid in (geographical) degree.
Details
This function calculates the dimension of the grid which should be used for a species richness
estimation on a given database of species occurrence locations.
Value
The dimension which is needed to create a grid used for a species richness estimation on a given
database of species occurrence locations.
Author(s)
Examples
##load data
data([Link])
Description
Usage
Arguments
Details
This function calculates the distance of two points in a grid by the Pythagorean theorem.
Value
The distance of the two points as an numeric value based on geographical degrees.
Author(s)
Examples
##initialize data
point.a <- c(5,8)
point.b <- c(10,3)
Description
This function extracts the row number of narrow endemic species in the given dataset.
Usage
getNarrowEndemics([Link], [Link],
[Link], dimension, shift,
resolution)
Arguments
[Link]
A dataset containing all observed species with their ID (named: speciesID) and
the longitude (named: long) and latitude (named: lat) of their occurrence loca-
tion.
[Link] A vector with the numbers of the species which should be mentioned. If the first
value is -1, all species in the database will be used.
[Link]
This value determines the limit of points and the maximum distance of these
points up to which a species is considered as narrow endemic species.
dimension The dimension of the grid which should be processed.
shift The geographic coordinates of the origin of the grid which should be processed.
resolution The resolution of the grid which should be processed in (geographical) degree.
Details
This function extracts the row numbers of narrow endemic species in the given datasets.
Value
This function returns a vector containing the row numbers of narrow endemic species in the given
dataset.
Author(s)
Examples
## load data
data([Link])
Description
This function calculates the origin of the grid used for a species richness estimation.
Usage
getShift([Link])
Arguments
[Link]
A dataset containing all observed species with their ID (named: speciesID) and
the longitude (named: long) and latitude (named: lat) of their occurrence loca-
tion.
Details
This function calculates the coordinates of the origin of the grid which should be used for a species
richness estimation.
Value
The coordinates of the origin of the grid used for species richness estimation.
Author(s)
Examples
##load data
data([Link])
Description
This routine searches clusters in the result grid of species richness estimation.
Usage
searchClusters([Link], dimension, shift, resolution, clusterlimit)
Arguments
[Link]
The grid that should be adjusted. It contains the result of species richness esti-
mation or cross-validation.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
clusterlimit The limit under which values of ’[Link]’ should not be used to build
clusters.
Details
This routine searches clusters in the result grid of species richness estimation to find centers of
species richness.
Value
This function returns a list containing vectors of the position of pixels which belong together.
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
24 [Link]
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
##prepare clustersearch
clusterlimit <- 100
Description
This function estimates the species range based on given occurrences of one species.
Usage
[Link]([Link], distance, dimension, shift,
resolution=1, landwatermask, upperbound, [Link]=FALSE)
Arguments
[Link]
A dataset containing one species with its ID (named: speciesID) and the longi-
tude (named: long) and latitude (named: lat) of the occurrence locations of that
species.
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0. Additional, height-informations could be added for land surfaces. In this
case, take care of the ’upperbound’ value.
[Link] 25
distance The maximum distance in which two occurrences are considered as related oc-
currences. These two occurrences will be connected with an edge.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
upperbound This value determines the height (based on values in ’landwatermask’) which is
considered to be a barrier for species distribution.
[Link]
A logical value determining wether a cross-validation is performed.
Details
This routine estimates the species range based on given occurrences of one species through a geo-
metric interpolation model (details in Raedig et al. 2010).
Value
This function returns a grid which contains the species range information.
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
Description
This function estimates the species richness based on given species occurrences.
Usage
[Link]([Link], landwatermask,
distances=2:10, weight=0.5, dimension, shift, resolution=1,
upperbound, [Link]=-1, silent=TRUE, [Link]=FALSE)
Arguments
[Link]
A dataset containing the species with their ID (named: speciesID)and the longi-
tude (named: long) and latitude (named: lat) of their occurrence location.
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0. Additional, height-informations could be added for land surfaces. In this
case, take care of the ’upperbound’ value.
distances The distances which will be used for species range estimation.
weight The tuning parameter of the weighting procedure (details in Raedig et al. 2010).
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
upperbound This value determines the height (based on values in ’landwatermask’) which is
considered to be a barrier for species distribution.
[Link] The vector with the numbers of the species which should be mentioned. If the
first value is -1, all species in the database will be used for species richness
estimation.
silent A boolean flag that determines wether the report of status messages should be
suppressed or not.
[Link] A boolean flag determining wether the function uses the ’foreach’-package to
estimate species richness via parallel processing.
Details
This routine estimates the species richness based on given species occurrences through a geometric
interpolation model (details in Raedig et al. 2010).
Value
This function returns a grid which contains the weighted species richness information.
[Link] 27
Author(s)
Maximilian Lange, Sven Lautenbach, Claudia Raedig
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
Description
This function cross-validates the species richness based on given species occurrences.
Usage
[Link]([Link], landwatermask, fold=5,
[Link]=10, distances=3:10, weight=0.5, dimension, shift,
resolution=1, upperbound, [Link]=-1,
silent=TRUE, [Link]=FALSE)
Arguments
[Link]
A dataset containing the species with their ID (named: speciesID)and the longi-
tude (named: long) and latitude (named: lat) of their occurrence location.
28 [Link]
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0. Additional, height-informations could be added for land surfaces. In this
case, take care of the ’upperbound’ value.
fold The number of groups which should be created if the number of occurrences is
greater than [Link].
[Link] The limit below which the subsamples are created for a leave-one-out-cross-
validation instead of a k-fold-cross-validation.
distances The distances which will be used for species range estimation.
weight The tuning parameter of the weighting procedure (details in Raedig et al. 2010).
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
upperbound This value determines the height (based on values in ’landwatermask’) which is
considered to be a barrier for species distribution.
[Link] The vector with the numbers of the species which should be mentioned. If the
first value is -1, all species in the database will be used for species richness
estimation.
silent A boolean flag that determines wether the report of status messages should be
suppressed or not.
[Link] A boolean flag determining wether the function uses the ’foreach’-package to
cross-validate via parallel processing.
Details
This routine cross-validates the species richness based on given species occurrences through a geo-
metric interpolation model (details in Raedig et al. 2010).
Value
This function returns a grid which contains the cross-validated species richness information.
Author(s)
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
[Link] 29
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
Description
The main function to estimate or cross-validate the species richness based on given species occur-
rences.
Usage
[Link]([Link], [Link],
[Link], distances=1:10, weight=0.5, resolution=1,
[Link]=FALSE, [Link]=5, upperbound=5,
[Link]=FALSE, fold=5, [Link]=10,
[Link]=FALSE, [Link]="Interpolated Species Richness",
directory=getwd(), filename="[Link]",
evaluation=FALSE, [Link]="Histogramm", adjust=FALSE,
clusterlimit=100, predefinedClusterlist=NULL, [Link]=-1,
export=FALSE, drivername="GTiff", exportname="[Link]",
noninterpolatedgrid=NULL, silent=TRUE, [Link]=FALSE)
Arguments
[Link]
A dataset containing all observed species with their ID (named: speciesID) and
the longitude (named: long) and latitude (named: lat) of their occurrence loca-
tion.
30 [Link]
[Link]
A dataset containing the percentage of land on a cell of a grid. The coor-
dinates of the cell should be given as longitude (named: long) and lattude
(named: lat) and the percentage of land shoud be named landsum. If the value of
’[Link]’ is ’NULL’, the land-water-information has no effect on the
species richness estimation.
[Link] A dataset containing the longitude and lattitude of the grid cell location as ’long’
and ’lat’ and the height of the cell as ’height’. If the value of ’[Link]’ is
’NULL’, the height-information has no effect on the species richness estimation.
distances The distances which will be used for species range estimation or cross valida-
tion.
weight The tuning parameter of the weighting procedure (details in Raedig et al. 2010).
resolution The resolution of the grid in (geographical) degree.
[Link] A boolean flag that determines if only narrow endemic species should be con-
sidered in species richness estimation.
[Link]
This value determines the limit of points and the maximum distance of these
points up to which a species is considered as narrow endemic species.
upperbound This value determines the height which is considered to be a barrier for species
distribution.
[Link]
A logical value determining wether a cross-validation is performed. If the value
is true, the parameters [Link] and [Link] will be ig-
nored.
fold The number of groups which should be created if the number of occurrences is
greater than [Link].
[Link] The limit below which the subsamples are created for a leave-one-out-cross-
validation instead of a k-fold-cross-validation.
[Link] A boolean flag that determines if an image (PNG-File) should be created.
[Link] The heading of the created image.
directory The directory in which the created files should be stored.
filename The filename of the created PNG-Files.
evaluation A boolean value determining wether the routine ’evaluate’ is used or not. If the
value is true, a PNG-File with a histogramm of the result grid will be created.
[Link] The heading of the created histogramm.
adjust A boolean value determining wether an adjustment of the result grid should be
done or not.
clusterlimit The limit under which values of ’[Link]’ should not be used to build
clusters. Each cluster will be adjusted with an own centre of species richness.
predefinedClusterlist
A list of vectors of pixelpositions (created by ’searchClusters’) which are spa-
tial related. The default value is NULL because the list will be created if ’ad-
just’ is ’TRUE’, but it may be useful for robustness estimation, because the
[Link] 31
cross-validation result should be adjusted with the same clusterlist as the related
species richness estimation (and without a pre-defined clusterlist, other clusters
will be build).
[Link] A vector with the numbers of the species which should be mentioned. If the first
value is -1, all species in the database will be used.
export A boolean value that determines if the routine should export the results as GDAL
grid map.
drivername Determines the format of the resulting GDAL grid map. All available drivers
can be shown by using the command ’gdalDrivers()’.
exportname The name of the created file containing the GDAL grid map.
noninterpolatedgrid
A grid containing the species occurrences (could be created via function ’cre-
ateNonInterpolatedGrid’). If the value of this parameter is ’NULL’, it will be
created if an adjustment should be done. The parameter may be usefull to save
time while processing more than one ’[Link]’.
silent A boolean flag that determines wether the report of status messages should be
suppressed or not.
[Link] A boolean flag determining wether the function uses the ’foreach’-package to
process parallel.
Details
This routine is the main function of this package. It eithor estimates or cross-validates the species
richness based on given species occurrences through a geometric interpolation model (details in
Raedig et al. 2010).
Value
This function returns a grid which contains either the weighted or the cross-validated species rich-
ness information. Additionally, an image (PNG-File) of that grid could be created.
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
data([Link])
data([Link])
32 [Link]
[Link]
Species richness estimation without weighting
Description
This function estimates the species richness for a given distance based on given species occurrences
without using weighting factor.
Usage
[Link]([Link], landwatermask,
distance=10, dimension, shift, resolution=1,
upperbound, [Link]=-1, silent=TRUE,
[Link]=FALSE)
Arguments
[Link]
A dataset containing the species with their ID (named: speciesID)and the longi-
tude (named: long) and latitude (named: lat) of their occurrence location.
landwatermask A grid containing the land-water-information of the observed area. If a grid cell
containes no land, the value of the cell in the landwatermask is -1, otherwise it
is 0. Additional, height-informations could be added for land surfaces. In this
case, take care of the ’upperbound’ value.
distance The distance which will be used for species range estimation.
dimension The dimension of the processed grid.
shift The geographic coordinates of the origin of the grid.
resolution The resolution of the grid in (geographical) degree.
upperbound This value determines the height (based on values in ’landwatermask’) which is
considered to be a barrier for species distribution.
[Link] The vector with the numbers of the species which should be mentioned. If the
first value is -1, all species in the database will be used for species richness
estimation.
silent A boolean flag that determines wether the report of status messages should be
suppressed or not.
[Link] A boolean flag determining wether the function uses the ’foreach’-package to
estimate species richness via parallel processing.
[Link] 33
Details
This routine estimates the species richness for a given distance (without weighted summation)
based on given species occurrences through a geometric interpolation model (details in Raedig
et al. 2010).
Value
This function returns a grid which contains the species richness information for a given distance.
Author(s)
Maximilian Lange, Sven Lautenbach
References
Raedig, C., Dorman, C.F., Hildebrandt, A. and Lautenbach, S. (2010). Reassessing Neotropical
angiosperm distribution patterns based on monographic data: a geometric interpolation approach.
Biodivers Conserv, 19, 1523-1546.
Examples
##load data
data([Link])
data([Link])
##create landwatermask
[Link] <- createLandwatermask([Link],
dimension, shift, resolution=1)
∗Topic datasets
[Link], 10
[Link], 11
[Link], 11
[Link], 2
adjustment, 3
createHeightmask, 4
createImage, 5
createLandwatermask, 7
createNonInterpolatedGrid, 8
[Link], 9
[Link], 10
[Link], 11
[Link], 11
edgeNotValid, 12
evaluate, 13
exportAsGDAL, 15
[Link], 16
[Link], 17
[Link], 18
getDimension, 19
getDistance, 20
getNarrowEndemics, 21
getShift, 22
searchClusters, 23
[Link], 24
[Link], 26
[Link], 27
[Link], 29
[Link], 32
34