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)

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)

rangeMapper documentation built on May 29, 2017, 12:08 p.m.