dpwritedata: Write data of resource to file

View source: R/dpwritedata.R

dpwritedataR Documentation

Write data of resource to file

Description

Write data of resource to file

Usage

dpwritedata(x, ..., write_codelists = TRUE)

## S3 method for class 'datapackage'
dpwritedata(
  x,
  resourcename,
  data,
  writer = "guess",
  ...,
  write_codelists = TRUE
)

## S3 method for class 'dataresource'
dpwritedata(
  x,
  data,
  datapackage = dpgetdatapackage(x),
  writer = "guess",
  ...,
  write_codelists = TRUE
)

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_codelists

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

resourcename

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_codelists 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.

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.


djvanderlaan/datapackage documentation built on March 18, 2024, 4:57 p.m.