View source: R/export_hobo_2008.R
| export_hobo_2008 | R Documentation |
This function uses the raindancer package to processes data from Onset HOBO loggers used in the SEUG LTMVP from 2008-2019. It then exports the data to a Microsoft Access database.
export_hobo_2008( my_file, my_db, import_table, raw_data_table, prcp_data_table, temp_rh_data_table, details_table, verbose = TRUE, view = TRUE )
my_file |
A character string of the complete file path of your *.csv file. |
my_db |
A connected database from |
import_table |
A character string of the name of the import log table. |
raw_data_table |
A character string of the name of the raw data table. |
prcp_data_table |
A character string of the name of the processed precipitation data table. |
temp_rh_data_table |
A character string of the name of the processed temperature and relative humidity data table. |
details_table |
A character string of the name of the logger details table. |
verbose |
Logical. Show messages showing progress. Default is TRUE. If FALSE, messages are suppressed. |
view |
Logical. Prints data to console before writing them to the database. Default is TRUE. If FALSE, data are not printed and there is no prompt before writing data to the database. |
This function uses two functions from the raindacer package.
import_hobo_2008 is usec to read Hobo data in
into R, and then process_hobo is used to
summarize the data. The processed data are then exported to a connected
Microsoft Access database.
Data is written to database tables. Objects are not returned.
raindancer,
import_hobo_2008,
raindance, sundance,
process_hobo, RODBC,
sqlSave, odbcConnectAccess2007
## Not run:
library("raindancer")
library("dataprocessR")
# Connect to DB
my_db <- RODBC::odbcConnectAccess2007("C:/path/to/database.accdb")
# List files
my_dir <- "C:/path/to/data"
file_list <- list.files(my_dir, pattern = ".csv", full.names = TRUE,
recursive = FALSE)
# Select file
my_file <- file_list[10]
# Process file and save to database
export_hobo_2008(my_file = my_file, my_db = my_db,
import_table = "tblWxImportLog",
raw_data_table = "tblWxData_raw",
prcp_data_table = "tblWxData_PRCP",
temp_rh_data_table = "tblWxData_TEMP_RH",
details_table = "tblWxLoggerDetails")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.