dpgetdata | R Documentation |
Get the data belonging to a Data Resource
dpgetdata(x, ..., as_connection = FALSE)
## S3 method for class 'dataresource'
dpgetdata(x, reader = "guess", ..., as_connection = FALSE)
## S3 method for class 'datapackage'
dpgetdata(x, resourcename, reader = "guess", ..., as_connection = FALSE)
x |
a |
... |
passed on to the |
as_connection |
Try to return a connection to the data instead of the data itself. When a reader does not support returning connections it will return the data. |
reader |
the reader to use to read the data. This should be either a
function accepting the path to the data set (a character vector with possibly
multitple filenames) and the Data Resource as second argument, or the
character string |
resourcename |
the name of the |
When reader = "guess"
the function will try to guess which reader to
use based on the format
and mediatype
of the Data Resource.
Currently only CSV is supported. For other data types a custom reader has to
be provided unless the data is stored inside the Data Resource object.
It is also possible to assign default readers for data formats. For that see
dpaddreader
.
Will return the data. This will generally be a data.frame
but
depending on the file type can also be other types of R-objects.
When called with the as_connection = TRUE
argument, it will try to
return a connection to the data. This depends on the reader. When the reader
does not support returning connections it will return the data.
dpgetconnection
is a wrapper around
dpgetdata(..., as_connection = TRUE)
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.