fars_read_years: Title fars_read_years

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function receives a list of years (one or several years) and calls the make_filename() function for each year and then fills those files with the corresponding year data from the main data set.

Usage

1

Arguments

years

of one or more years

Details

if one year is not valid an error will be generated and the function will stop

Uses make_filename(year)

Value

Creates one or more datasets based on year number. Returns NULL if there is an error

Examples

1
2
3
4
5
6
x <- setwd(system.file("extdata", package = "packagefars"))
# Data with the car fatalities in 2013.
fars_read_years(2013)
# Data with the car fatalities in 2013 and 2014.
fars_read_years(c(2013, 2014))
setwd(x)

marcelamu95/repo_packagefars documentation built on Nov. 4, 2019, 5:22 p.m.