get.SRDLpg: 'get.SRDLpg' runs a query to fetch data from SMRU PostgreSQL...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getSRDLpg.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
get.SRDLpg(
  theDB = "SRDL",
  theTable = "dive",
  theFields = "All",
  theDep = "ct34",
  theRef = "All",
  theHost = "localhost",
  thePort = 5432,
  theUser = "postgres",
  thePwd = "12345"
)

Arguments

theDB

Name of database

theTable

Name of database table

theFields

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

theDep

Either an exact name of a deployment program to be loaded, or a wildcard for similarly named deployment programs.

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

Value

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

Author(s)

Martin Biuw

See Also

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

Examples

1
2
dive <- get.SRDLpg('SRDL', 'dive', 'All', 'ct34-2447-08')
dive <- get.SRDLpg('SRDL', 'dive', c('ref', 'de_date', 'surf_dur', 'dive_dur', 'max_dep')

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