View source: R/choose_data_source.R
choose_data_source | R Documentation |
Var and site are always required fields. logic is required by has a default value that may be used without explict specification. For every element of logic that equals one of the default options, the specified chosing algorithm will be used to supply values for type and src. If logic is unrecognized, then type and src are also required and the row will be constructed from the manually specified elements of site, type, src, and logic.
choose_data_source(var, site, logic = c("priority local", "unused var"),
type = c(NA, "ts", "meta", "ts_file", "const", "pred", "pred_file", "none"),
src = NA, with_ts_version = "rds", with_ts_archived = FALSE,
with_ts_uploaded_after = "2015-01-01")
var |
character. A single variable name as in
|
site |
character. The site code or codes for which to choose data. |
logic |
character specifying the algorithm to use, or the manual logic
that was used by the user, to choose the |
type |
character in |
src |
character indicating a src to be interpreted in the context of
|
with_ts_version |
one or more of |
with_ts_archived |
one or more of |
with_ts_uploaded_after |
POSIXct, or convertible to POSIXct, giving date after which a ts must have been uploaded to count |
a 4-column data.frame component of a config file
## Not run:
choose_data_source(var="baro", site="nwis_03067510", logic='priority local')
# expect warnings:
choose_data_source(var="baro", site=c("nwis_08062500","nwis_03067510"),
logic='my made-up data', type="ts_file", src=c("myfile1.txt","myfile2.txt"))
choose_data_source(var="dosat", site="nwis_03067510", logic='priority local')
# as in default to stage_metab_config
site=list_sites(c("doobs_nwis","disch_nwis","wtr_nwis"))[40:49]
sitetime=choose_data_source("sitetime", site)
doobs=choose_data_source("doobs", site)
dosat=choose_data_source("dosat", site)
depth=choose_data_source("depth", site)
wtr=choose_data_source("wtr", site)
par=choose_data_source("par", site)
# as in verify_config
choose_data_source(var="doobs", site="dummy_site", logic="manual", type="ts", src="simCopy")
# for K
K600=choose_data_source("K600", "nwis_08062500")
login_sb()
K600=choose_data_source(var="K600", site="nwis_08062500", logic="nighttime reg",
type="pred", src="0.0.6")
K600=choose_data_source(var="K600", site="nwis_08062500", logic="nighttime reg",
type="pred", src="nwis_08062500-307-150730 0.0.6 nighttime_k_plus_data")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.