View source: R/dp_generate_dataresource.R
dp_generate_dataresource | R Documentation |
Generate Data Resource for a dataset
dp_generate_dataresource(
x,
name,
path = paste0(name, getextension(format)),
format = "csv",
mediatype = getmediatype(format),
use_existing = FALSE,
categories_type = c("regular", "resource"),
categorieslist = iscategorieslist(x),
...
)
x |
|
name |
name of the Data Resource |
path |
name of the file in which to store the dataset. This should be a path relative to the location of the directory in which the Data Package in which the Data Resource will be stored. |
format |
the data format in which the data is stored. |
mediatype |
mediatype of the data |
use_existing |
use existing field descriptors if present. |
categories_type |
how should categories be stored. See
|
categorieslist |
does the data resource function as a categories list for fields in another data resource |
... |
Currently ignored |
Returns a Data Resource object.
Note that this function does not create the file at path
. The export
of the Data Resource is automatically set to CSV.
# generate an example dataset
dta <- data.frame(a = 1:3, b = factor(letters[1:3]))
resource <- dp_generate_dataresource(dta, "example")
print(resource)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.