Description Usage Arguments Value Examples
The function CHMselect can be used to get data from the DESC chemistry database. A standard SQL query is issued to the database and the values are returned in dataframe. The data returned can be limited by a start and/or end date defined by the user.
1 2 |
channel |
connection handle as returned by odbcConnect |
STATION |
station number |
LDESC |
location description given during sample submissions |
TEST_NAME |
the test name short form found in the lab submission manual |
SUBNUM |
submission number |
startDate |
access data from this date forward |
endDate |
access data up to this date |
A data frame
1 2 3 4 5 6 7 8 9 10 11 12 | # Establish connection with database
CHM = odbcConnect("Connection", "User id", "Password")
# Extract all data by STATION
tmp <- CHMselect(CHM, STATION = '03008557402')
# Extract data by STATION and multiple TEST_NAME.
tmp = CHMselect(CHM, STATION = '03008557402', TEST_NAME = c('PPUT1','PPUT2'))
# Limit extraction by date.
tmp = CHMselect(CHM, STATION = '03008557402', TEST_NAME = 'PPUT1',
startDate = "2015-09-01", endDate = "2015-11-01")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.