Learn R Programming

datapackage (version 0.2.1)

dp_write_data: Write data of resource to file

Description

Write data of resource to file

Usage

dp_write_data(x, ..., write_categories = TRUE)

# S3 method for datapackage dp_write_data( x, resource_name, data, writer = "guess", ..., write_categories = TRUE )

# S3 method for dataresource dp_write_data( x, data, datapackage = dp_get_datapackage(x), writer = "guess", ..., write_categories = TRUE )

Value

The function doesn't return anything. It is called for it's side effect of creating files in the directory of the Data Package.

Arguments

x

the Data Package or Data Resource to which the data is to be written to.

...

additional arguments are passed on to the writer function.

write_categories

write both the data set x itself and any categories lists of fields in the data set.

resource_name

name of the Data Resource in the Data Package to which the data needs to be written.

data

data.frame with the data to write.

writer

the writer to use to write the data. This should be either a function accepting the Data Package, name of the Data Resource, the data and the write_categories argument or the character string "guess".

datapackage

the Data Package to which the data needs to be written.

Details

When writer = "guess" the function will try to guess which writer to use based on the format and mediatype of the Data Resource.