rmap_save_subset creates subsets based on the canvas properties and/or the properties of one or several bio tables.

rmap_save_subset(con, dst, ...)

# S4 method for rmapConnection,character
rmap_save_subset(con, dst, ...)

Arguments

con

a rangeMapper connection made with rmap_connect().

dst

the name of the new subset table.

...

SQL WHERE calls, see Details.

Value

TRUE when the database view is written to the project file, FALSE otherwise.

Details

Subsets are defined using table_name = "CONDITION" where CONDITION can be any SQL WHERE call defined for the given table. Here is a summary of the SQL operators relevant in this context:

OperatorDescription
= or == or IS or ! = or <> or IS NOTEquals or Non-equals.
> or < or >= or <=Greater (Less) than (or equal).
IN or NOT INmultiple given values e.g. a IN (a,b,c,x,y).
BETWEENBetween a given range (given values included) e.g. BETWEEN 1 and 10.
LIKEPattern search e.g. LIKE "%keyword%". LIKE is case insensitive.
GLOBSimilar to LIKE but uses the Unix wildcards (*,?,[]). e.g. [a-zA-Z0-9] matches any single alphanumeric. GLOB` is case sensitive.

Examples

require(rangeMapper) con = rmap_connect() wrens = read_wrens() rmap_add_ranges(con, x = wrens, ID = 'sci_name') rmap_prepare(con, 'hex', cellsize = 500)
#> --> Making hex canvas ...
#> done.
#> (i) The canvas has 576 cells.
#> --> Processing 84 ranges ...
#> --> Updating rmap_nfo & rmap_master tables ...
#> done.
#> (i) Finished in 0.132s elapsed (0.111s cpu)
rmap_add_bio(con, wrens, 'sci_name') rmap_save_map(con) rmap_save_subset(con,'s1', species_richness = 'species_richness > 10', wrens = 'body_mass > 19 AND clutch_size > 3') dbDisconnect(con)