processRanges: processRanges

Description Usage Arguments Methods (by class) Note Examples

Description

processRanges

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
processRanges(con, spdf, dir, ID, metadata)


  ## S4 method for signature 
## 'SQLiteConnection,SpatialPolygonsDataFrame,missing,character,missing'
processRanges(con,
  spdf, ID, metadata)


  ## S4 method for signature 
## 'SQLiteConnection,SpatialPolygonsDataFrame,missing,character,list'
processRanges(con,
  spdf, ID, metadata)


  ## S4 method for signature 'SQLiteConnection,missing,character,missing,missing'
processRanges(con,
  dir)

## S4 method for signature 'SQLiteConnection,missing,character,missing,list'
processRanges(con,
  dir, metadata)

Arguments

con

a connection object.

spdf

SpatialPolygonsDataFrame object containing all the ranges.

dir

ranges file directory where the individual ranges shp files are located. In this case the range ID is the file name.

ID

a character vector of length one. An spdf column name indicating the range ID (e.g. species name).

metadata

a named list of functions. See rangeTraits and metadata.update.

Methods (by class)

  • con = SQLiteConnection,spdf = SpatialPolygonsDataFrame,dir = missing,ID = character,metadata = missing: Method 1: One SpatialPolygonsDataFrame containing all the ranges. No metadata.

  • con = SQLiteConnection,spdf = SpatialPolygonsDataFrame,dir = missing,ID = character,metadata = list: Method 2: One SpatialPolygonsDataFrame containing all the ranges. Metadata are computed.

  • con = SQLiteConnection,spdf = missing,dir = character,ID = missing,metadata = missing: Method 3: Each range file is a separate shp file. No metadata.

  • con = SQLiteConnection,spdf = missing,dir = character,ID = missing,metadata = list: Method 4: Each range file is a separate shp file. Metadata are computed.

Note

if a parallel backend is registered with the foreach package then processRanges runs in parallel.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
require(rangeMapper)
require(rgdal)
## Not run: 
if (require(doParallel) ) {
 cl = makePSOCKcluster(2)
 registerDoParallel(cl)
 }

## End(Not run)

dbcon = rangeMap.start(file = "wrens.sqlite", dir = tempdir(), overwrite = TRUE)
f = system.file(package = "rangeMapper", "extdata", "wrens", "vector_combined")
r = readOGR(f, "wrens", verbose = FALSE)
global.bbox.save(con = dbcon, bbox = r)
gridSize.save(dbcon, gridSize = 2)
canvas.save(dbcon)
processRanges(con = dbcon, spdf = r, ID = "sci_name", metadata = rangeTraits() )

## Not run: 
stopCluster(cl)

## End(Not run)


Search within the rangeMapper package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.