Description Usage Arguments Details
Read a CSVY file
1 2 |
file |
Name of file to read. |
metadata |
Path to additional metadata. If |
verbose |
Logical. If |
tbl |
Logical. If |
data.table |
Logical. If |
... |
Additional arguments to data.table::fread |
A CSVY (CSV + YAML) file is just a CSV file prepended with a YAML header containing relevant metadata. The metadata can be any list or list-like object, and any fields not specially recognized will be parsed by yaml::read_yaml and stored as named attributes. The following metadata fields are parsed specially:
fread
– contains the arguments to be passed to data.table::fread,
such as the field separator (sep
) and NA
strings (na.strings
). In
general, this is not necessary because fread
has sensible defaults and is
clever about figuring such things out, but it may improve performance or
reliability for particularly large or complex files.
resources: fields
(Single item fields
nested inside root item
resources
) – A list of metadata for the table columns. These are
structured generally following the TableSchema of a Tabular DataPackage with a few
R-friendly modifications. All of these fields are optional, though some can
be deduced automatically during the writing process. Some common fields are
as follows (fields with *
following their labels are not in the Table
Schema):
name
– Name of field, corresponding to column name in data
title
– A human-readable label for the field
description
– A description for the field
type
– String specifying the schema type (see schema_type_dict)
class*
– String or array specifying the R class
(es) to which the
object belongs.
constraints
– A list of constraints on the data (see Table Schema:Constraints).
Eventually, all of these will be actively used by R to verify data.
missingValues
– An array of strings that are used to indicate missing
values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.