read.fish: Query and Read PAWMAP Fish Data

View source: R/read.fish.R

read.fishR Documentation

Query and Read PAWMAP Fish Data

Description

Query PAWMAP electrofishing data and read the data into R.

Usage

read.fish(..., start = end - 7, end = Sys.Date(), server = NULL)

Arguments

...

query parameters in tag = value form

start

an object of class Date; the earliest survey start date to retrieve

end

an object of class Date; the latest survey start date to retrieve

server

Alternate server for the WATERSHED database - for access to production or test instances.

Details

The function accepts a start and end date along with query arguments in the form of tag = value statements which correspond to valid fields in the database view (WATERSHED.V_RPT_WATERSHED) used to access the data. The start and end parameters are queried against the collection_start_date field.

The user running R must have permission to access the database view and must have a ODBC Data Source set up for the view on the current computer. The reporting server version of the view is currently BESREPORTS.WATERSHED.V_RPT_WATERSHED. In addition, different ODBC connections must be set up for 32 and 64 bit versions of R. The RODBC::odbcDataSources() function can be used to check the currently available data sources from within R.

Examples

## Not run: 
#List the available fields
library(RODBC)
con <- BESdata:::dbConnect("WATERSHED")
sqlColumns(con, "V_RPT_WATERSHED")
#Get some data
d <- read.fish(start = as.Date('2017-01-01'), end = as.Date('2017-03-01'))

## End(Not run)

jasonelaw/BESdata documentation built on Nov. 3, 2023, 9:32 a.m.