fars_read_years: Create new dataframe from csv file

Description Usage Arguments Value

Description

This function modifies the dataframe from a csv file read into R. The csv file is of the form "accident_2013.csv.bz2", where 2013 is the year of interest. The new dataframe has variables month and year. The single argument is years, a list of years such as list(2013,2014,2015). The function uses lapply to loop through the list of years to create the new dataframe. The function calls the internal function make_filename(year) to get a file name and the internal function fars_read(file) to read the csv file into R. An error is generated if the year does not exist or if the file does not exist

Usage

1

Arguments

years

a list of years such as list(2013,2014,2015) year be an integer.

Value

function returns a list of dataframes or NULL if the available files do not include the year of interest.

examples \donotrun dat_list <- fars_read_years(list(2013,2014,2015))


EdwardKoonce/farsSimple documentation built on May 23, 2019, 3:11 p.m.