fars_read_years: Read multiple fars

Description Usage Arguments Details Value Examples

Description

Import a set of fars files given the vector of their years.

Usage

1
fars_read_years(years, path = ".")

Arguments

years

(num) An integer vector of years (or an object cohercible to it) containing the years of fars files of interest.

path

(chr) path to the fars file

Details

Computation does not stop if the file does not exist: a warning is produced and NULL is stored in the corresponding slot of the output list.

Value

A list of data frame, one for each year privided in input, with two columns: MONTH, and YEAR of the corresponding fars file. If the file does not exist NULL is stored in the corresponding slot of the list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
    file_path <- system.file("tests", "testthat",
        package = "weektwo"
    )

    fars_read_years(c(2012, 2013, 2014), path = file_path) # one warn
    fars_read_years(c(2013, 2014)) # no warning
    fars_read_years(c("2012", "2013", "2014")) # works with characters

## End(Not run)

CorradoLanera/weektwo documentation built on May 8, 2019, 12:51 p.m.