Learn R Programming

rangeMapper (version 0.0-6)

rangeMap.save: Save a rangeMap

Description

Compute a chosen statistic (e.g. richness (count), mean, median or any user-defined statistic) at each grid cell.

Usage

rangeMap.save(CON, tableName, FUN, biotab, biotrait, subset, path , overwrite, ...)

Arguments

CON
An sqlite connection pointing to a valid rangeMapper project.
tableName
Name of the table (quoted) to be added to the sqlite database. The prefix MAP will be appended to tableName prior to saving.
FUN
the function to be applied to each pixel. If FUN is missing then species richness (species count) is computed.
biotab
character string identifying the BIO table to use.
biotrait
character string identifying the ID of the BIO table. see bio.save
subset
A named list. See details
path
Path to the raster file(quoted) to be imported to the existing project. raster package is required at this step.
overwrite
If TRUE then the table is removed
...
When R is an R function, ... denotes any extra arguments to be passed to it.

Value

  • Returns TRUE when the MAP was created successfully.

Details

The subset argument accepts a named list. Names refers to BIO, MAP and metadata_rages table names while the strings in the list are character strings containing the SQL WHERE clause. The subset can point to only one table type (e.g. list(MAP_species_richness = "species_richness > 500") ) or can point to several table types (e.g. list(BIO_lifeHistory = "clutch_size > 4", MAP_meanAltitude = "meanAltitude < 1000", metadata_ranges = "Area < 1000") ) Any valid SQL expression can be used. See http://www.sqlite.org/lang_expr.html

See Also

rangeMapper for a complete example.