| oecdOptions | R Documentation |
Read or Set OECDdata Options.
oecdOptions(...)
clearCache()
... |
Named option values without the |
All settings are ordinary R options prefixed with OECDdata..
"v2" by default; explicitly select "v1" for legacy routes.
"https://sdmx.oecd.org/public/rest". An HTTPS root ending in /rest, without /v2.
"en"; requested metadata language.
NULL; default context for labels and scoped metabase calls.
TRUE, NULL; a session temporary directory unless explicitly configured.
3600, 86400 seconds, respectively.
Both FALSE. Offline accepts expired but verified entries. Refresh bypasses cache reuse online.
120, 20 seconds.
3, 60; retry count after the initial attempt and maximum allowed retry delay in seconds.
1 second between requests in this session.
60, 3600; local rolling data-attempt budget. Retries count; metadata requests do not.
TRUE, FALSE; compatible default result types.
FALSE, interactive(); suppress progress messages or control interactive reports.
"actual"; use "allowed" only for explicitly requested dictionary-code inventories.
Inf; optional response-size limit in bytes.
HTTP Retry-After is respected. Delays above the configured maximum produce an error, never an early retry. A local budget cannot account for other sessions sharing an IP address. It is not a guarantee against service throttling.
Cache identities include URL, media type and language. Entries carry checksums,
status and original download times. Only package-owned files are removed by
clearCache. No shared-process locking or automatic eviction is provided;
use a separate cache directory per concurrent writer. Checksums detect corruption
but are not a substitute for trusting the configured local directory.
The setter returns the prior namespaced settings invisibly. In a function,
use old <- oecdOptions(...) and
on.exit(options(old), add = TRUE) to restore them when leaving.
The size limit is enforced by libcurl when the server advertises a usable length and is checked after transfer and before returning a cached response as well. It is not an absolute bound on bytes received when a response has no advertised size.
With no arguments, oecdOptions returns a named settings list. When
setting options, it invisibly returns the previous, fully prefixed options, so
options(old) restores them. clearCache invisibly returns the number
of owned cache files removed, not the number of requests.
importData, importMetabase
old <- oecdOptions(quiet = TRUE, strings_as_factors = FALSE)
x <- oecdExample()
stopifnot(is.character(x$REF_AREA))
options(old)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.