read_hcd: Read Historical Climate Data files

read_hcdR Documentation

Read Historical Climate Data files

Description

Reads data from CSV files download from the Canada Historical Climate Data website. The function knows about hourly, daily, and monthly data formatted files.

Usage

read_hcd(file, flags = FALSE, clean = TRUE, ...)

Arguments

file

Either a path to a file, a connection. See argument file of read_csv.

flags

Logical; should variable flag columns be preserved. The default results in these columns being dropped from the returned data.

clean

Logical; should variable names be cleaned? The default replaces the variable identifiers from the CSV files with more useful names for use in R code.

...

Further arguments passed to read_csv.

Value

A tbl_df.

Author(s)

Gavin L. Simpson

FIXME: if hadley fixes the bug in count_fields, add it back here as

import from readr & remove utils import

Examples

## read a monthly data file
read_hcd(system.file("extdata/2855-monthly-data.csv", package = "canadaHCD"))

## read a daily data file
read_hcd(system.file("extdata/2855-daily-data-2015.csv",
  package = "canadaHCD"))

gavinsimpson/canadaHCD documentation built on Sept. 23, 2023, 3:13 a.m.