read.fish | R Documentation |
Query PAWMAP electrofishing data and read the data into R.
read.fish(..., start = end - 7, end = Sys.Date(), server = NULL)
... |
query parameters in |
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. |
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.