parse_csv_header: parse_csv_header

parse_csv_headerR Documentation

parse_csv_header

Description

Parse a CSV file's header, if present.

Usage

parse_csv_header(obj, filename, header, enforce_requirements = TRUE)

Arguments

obj

The object to attach attributes to

filename

Fully-qualified filename

header

A vector of strings comprising the file header

enforce_requirements

Enforce mandatory fields?

Details

Headers are given at the top of files and consist of labels ("Title:", "Units:", etc) prefixed by comment characters (#). The parser looks for these, and calls add_title and similar functions to return an empty data frame with appropriate attribute set.

Value

An empty tibble with appropriate attributes filled in.


bpbond/gcamdata documentation built on March 22, 2023, 4:52 a.m.