View source: R/new_dataresource.R
new_dataresource | R Documentation |
Create a new Data Resource
new_dataresource(
name,
title = NULL,
description = NULL,
path = NULL,
format = NULL,
mediatype = NULL,
encoding = NULL,
bytes = NULL,
hash = NULL,
...
)
name |
The name of the Data Resource. |
title |
The title of the Data Resource. |
description |
The description of the Data Resource. |
path |
the path of the Data Resource |
format |
the format of the Data Resource |
mediatype |
the mediatype of the Data Resource |
encoding |
the encoding of the Data Resource |
bytes |
the number of bytes of the Data Resource |
hash |
the hash of the Data Resource |
... |
additional arguments are added as additional properties. It is checked if these are valid. |
Returns a dataresource
object which is a list with the properties of
the Data Resource.
dir <- tempdir()
dp <- new_datapackage(dir, name = "test-package")
res <- new_dataresource(name = "iris")
dp_title(res) <- "The Iris Data Set"
dp_encoding(res) <- "UTF-8"
dp_mediatype(res) <- "text/csv"
# resource adds a resource if it doesn't yet exist or updates
# an existing resource
dp_resource(dp, "iris") <- res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.