fars_read_years: This is a function that selects files containing a specified...

Description Usage Arguments Value Examples

View source: R/fars_functions.R

Description

This is a function that selects files containing a specified list of #'years, and in each data frame representing data of each selected file #'creats a new year columne, and finally select this new conlumn and the #'MONTH column.(using the years argument). The function "mutate" and "select" is imported from external package #'"dplyr"

Usage

1

Arguments

years

A list containing years to select. This function calls #'"fars_read" function to read files corresponding to the given years. For #'a given year, the file may not exist, and then will prints an error #'message "invalid year: ", year and return a NULL object for this #'year.

Value

This function returns a data frame containing the year column #'and the month column. As a side effect, this function also prints out these two columns.

Examples

1
2
3
4
WD <- setwd(system.file("extdata", package = "mypack"))
fars_read_years(2013)
fars_read_years(c(2013, 2014))
setwd(WD)

mtp22peng/mypack documentation built on May 17, 2019, 12:15 p.m.