get.SRDLdb: 'get.SRDLdb' runs a query to fetch data from SMRU Access...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/getSRDLdb.R

Description

get.SRDLdb runs a query to fetch data from SMRU Access database table, based on set criteria

Usage

1
2
3
4
5
6
7
get.SRDLdb(
  theDB = "ct34",
  theTable = "dive",
  theFields = "All",
  theRef = "ct34-2447-08",
  thePath = "C:/MamVisAD/SMRUAccessDatabases"
)

Arguments

theDB

Name of database as defined in ODBC data sources

theTable

Name of database table

theFields

Vector of names or numbers representing which fields to be fetched, or "All" to get all tables.

theRef

ref code of specific animal for which data should be fetched. Can be either "All" for entire table, or one specific ref code. There is currently no support for subsets of multiple ref codes

thePath

Path to folder where database is located, if running in 64-bit R.

Details

The database must first be set up as a DSN data source. Note! On Windows, by default only 32-bit data sources can be used and R (or RStudio) has to be run in 32-bit mode for these functions to work. However, functionality has now been extended (experimental for now) to run under 64-bit R. For this to worl, the path to the database must be specified.

Value

Returns a data frame with data from table following specified selection criteria.

Author(s)

Martin Biuw

See Also

tables.SRDLdb for database table names, fields.SRDLdb for table field names, ref.SRDLdb for ref ID codes, dep.SRDLdb for retrieving deployments metadata

Examples

1
2
dive <- get.SRDLdb('ct34', 'dive', c(c(1:35), c(79:80)), 'ct34-2447-08')
dive <- get.SRDLdb('ct34', 'dive', c('ref', 'DE_DATE', 'SURF_DUR', 'DIVE_DUR', 'MAX_DEP')

embiuw/rSRDL documentation built on Jan. 27, 2021, 8:11 p.m.