read.janus | R Documentation |
Submits a query to JANUS database view JANUS_ELEMENT using arbitrary tag=value query parameters.
read.janus(
...,
start = NULL,
end = NULL,
what = c("data", "location"),
server = NULL,
date.field = "sample_end_time",
as.text = T,
simple = F
)
read.janus.location(..., server = NULL, as.sf = TRUE)
... |
query arguments in the form 'field = value'. |
start |
start date of data range |
end |
end date of data range |
what |
whether to return data or locations only. |
date.field |
the field used for the start and end query arguments. |
as.text |
logical, return a text (TRUE) or numeric (FALSE) nondetect indicator in column 'nd'. |
dsn |
the dsn for the JANUS database on the current system |
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 table is currently BESREPORTS.WATERSHED.JANUS_ELEMENT.
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.
a dataframe of results
Jason Law jason.law@portlandoregon.gov
## Not run:
#List the available fields
library(RODBC)
con <- BESdata:::dbConnect("JANUS")
sqlColumns(con, 'JANUS_ELEMENT')
#Get the last 2 weeks of data
read.janus(start = Sys.Date() - 14)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.