od_resource | R Documentation |
Helper functions for caching and parsing open.data resources.
od_cache_dir(dir = NULL)
od_cache_clear(id, server = "ext")
od_cache_file(id, suffix = NULL, timestamp = NULL, ..., server = "ext")
od_resource(id, suffix = NULL, timestamp = NULL, server = "ext")
od_json(id, timestamp = Sys.time() - 3600, server = "ext")
od_resource_all(id, json = od_json(id), server = "ext")
dir |
If |
id |
A database id |
server |
the OGD-Server to use to load update the resources in case they
are outdated. |
suffix |
A suffix for the resource: |
timestamp |
A timestamp in |
... |
For internal use |
json |
The JSON file belonging to the dataset |
od_cache_clear(id)
removes all files belonging to the specified id.
By default, downloaded json files will "expire" in one hour or 3600 seconds.
That is, if a json is requested, it will be reused from the cache unless the
file.mtime()
is more than one hour behind Sys.time()
.
For od_cache_file()
and od_resource()
, the returned objects
contain a hidden attribute attr(., "od")
about the time used for
downloading and parsing the resource. od_resource_all()
converts these
hidden attribute into columns.
# get the current cache directory
od_cache_dir()
# Get paths to cached files
od_cache_file("OGD_veste309_Veste309_1")
od_cache_file("OGD_veste309_Veste309_1", "C-A11-0")
# get a parsed verison of the resource
od_resource("OGD_veste309_Veste309_1", "C-A11-0")
# get json metadata about a dataset
od_json('OGD_veste309_Veste309_1')
# Bundle all resources
od_resource_all("OGD_veste309_Veste309_1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.