assemblageFetch: Retrieves the species set of an arbitrary canvas cell

Description Usage Arguments Value Examples

Description

assemblageFetch retrieves the species set of an arbitrary canvas cell optionally with the associated life history data

Usage

1
2
3
4
5
6
7
assemblageFetch(object, xy, BIO)

## S4 method for signature 'rangeMap,SpatialPoints,missing'
assemblageFetch(object, xy)

## S4 method for signature 'rangeMap,SpatialPoints,character'
assemblageFetch(object, xy, BIO)

Arguments

object

A connection object.

xy

A SpatialPoints object.

BIO

The name of the BIO_table containing species life-history data.

Value

A data.frame containing the bioid (e.g. species names), the canvas id and optionally any associated life history data contained in the BIO_table table.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require(rangeMapper)
require(rgdal)

projName = "wrens.sqlite"
projLoc = paste(tempdir(), projName, sep = .Platform$file.sep)

dbcon = rangeMap.start(file = projName,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 = 3)
canvas.save(dbcon)
data(wrens)
bio.save(con = dbcon, loc = wrens ,  ID = "sci_name")
processRanges(spdf = r, con =  dbcon, ID = "sci_name")
rangeMap.save(dbcon)

sr = rangeMap.fetch(dbcon)
image(sr, axes = TRUE); grid()

p = list(x = -76.39, y = 9.26)
# or use locator:  p =  locator(1)

xy = SpatialPoints( do.call(cbind, p), proj4string = CRS("+proj=longlat +datum=NAD83 +no_defs ") )
af = assemblageFetch(rangeMap(projLoc) , xy)
points(p, col = 4, cex = 2)
print(af)

af = assemblageFetch(rangeMap(projLoc) , xy, "wrens")
print(af[, c(1, 4, 6:8)])

rangeMapper documentation built on May 19, 2017, 9:58 a.m.

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

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

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

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