new_dataresource {datapackage} | R Documentation |
Create a new Data Resource
Description
Create a new Data Resource
Usage
new_dataresource(
name,
title = NULL,
description = NULL,
path = NULL,
format = NULL,
mediatype = NULL,
encoding = NULL,
bytes = NULL,
hash = NULL,
...
)
Arguments
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. |
Value
Returns a dataresource
object which is a list with the properties of
the Data Resource.
Examples
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
[Package datapackage version 0.2.3 Index]