Learn R Programming

rangeMapper (version 0.2-6)

bio.save: Import BIO tables to a rangeMapper project.

Description

Import tables (e.g. life history data) to an active rangeMapper project.

Usage

bio.save(con, loc, tableName, ...)
	metadata2bio(con, ...)
	bio.merge(con, tableName, ...)

Arguments

con
An sqlite connection pointing to a valid rangeMapper project.
loc
file location or data.frame name
tableName
if missing, the name of the file or data.frame is used
...
Arguments to pass to the corresponding methods: e.g. the ID, the column corresponding to the names of the range files

Value

  • A BIO table is created in the corresponding rangeMapper project.

References

Valcu, M., Dale, J. and Kempenaers, B. (2012) rangeMapper: A platform for the study of macroecology of life history traits. 21(9). (DOI: 10.1111/j.1466-8238.2011.00739.x)

See Also

rangeMap.save. wrens

Examples

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

# Upload BIO tables
data(wrens)
Troglodytes  = wrens[grep("Troglodytes", wrens$sci_name), c(2, 5)]
bio.save(con = dbcon, loc = Troglodytes,  ID = "sci_name")

summary(rangeMap("wrens.sqlite"))$BIO_tables
setwd(wd)


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

wrensPath = system.file(package = "rangeMapper", "data", "wrens.csv")
bio.save(con = dbcon, loc = wrensPath,  ID = "sci_name")
bio.merge(dbcon, "wrensNew")
metadata2bio(dbcon)

summary(rangeMap("wrens.sqlite"))
setwd(wd)

Run the code above in your browser using DataLab