Learn R Programming

datamart (version 0.5.2)

csvdata: Create CsvData object from data.frame

Description

This function takes a data.frame, its metadata and a location. The function writes the data to the location and returns a CsvData object. The data.frame itself is not stored in this object.

Usage

csvdata(resource, dat, location, name = resource, dset.meta = NULL, cols.meta = NULL, update.fct = function(csv) return(data.frame()), verbose = TRUE, clss = "CsvData")

Arguments

resource
the name of the resource. Required.
dat
data.frame to convert to CsvData object. Required.
location
either a Location object, or a character pointing to a local directory. See details.
name
the physical name of the resource. Defaults to resource.
dset.meta
A list of metadata on the dataset.
cols.meta
A data.frame of metadata on the columns, rows are column names, columns are type, name, format
update.fct
function for updating the data. the update method and update interval is specified as meta data. Default is a function that returns an empty data.frame.
verbose
print diagnostic messages (default=TRUE)
clss
class to construct. Defaults to CsvData.

Details

If metadata is missing, it is set with sensible default values. The default values for the dataset metadata are title=, modified=, encoding='UTF-8', type='csv2', all other entries missing. The default values for column metadata are name=, type=, format='

No updating takes place here.