add_measurements_into_ssdb | R Documentation |
Add measurements ("measurements" table) to a SumavaDB-like spatiotemporal database
add_measurements_into_ssdb( conn, measurements, new = FALSE, append = !new, sql_files = system.file("sql/create_or_replace_functions.sql", package = "SuSnowDB"), warn = TRUE, err = !warn, nn_measurements = default_nn_measurements(), ... )
conn |
database (preferably PostgreSQL) connection. See output of |
measurements |
measurements table, data frame or an object that can be coerced to a data frame. See output of |
new |
logical. If |
append |
logical. If |
sql_files |
file names containing database initialization SQL queries. They are used in case |
warn |
logical argument if the column names of |
err |
logical argument if the column names of |
nn_measurements |
names of the columns in the "measurements" table. See the vignette. |
... |
further arguments (currently not used) |
## Not run: library(RPostgreSQL) dbname <- "hydroclimatedb_testing00" val <- sumava_snow_dataset() conn = dbConnect(PostgreSQL(), dbname = dbname) add_locations_into_ssdb(conn,val$locations,new=TRUE) add_measurement_types_into_ssdb(conn,val$measurement_types) add_measurements_into_ssdb(conn,val$measurements) ### Add weather station from MeteoTrentino network, Trentino, Italy val_smet <- meteotrentino_smet_dataset(smet_files=c("T0175","T0179")) add_locations_into_ssdb(conn,val_smet$locations,append=TRUE) add_measurement_type_into_ssdb(conn,val_smet$measurement_type,append=TRUE) add_measurements_into_ssdb(conn,val_smet$measurements,append=TRUE) dbDisconnect(conn) conn = dbConnect(PostgreSQL(), dbname = dbname) out <- dbReadTable(conn,"measurements") dbDisconnect(conn) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.