Description Usage Arguments Value Examples
This is a function to summarize multiple dataframes, each representing a year.
The summary output is returned as a dataframe, containing number of monthly
observations for each year. Given a vector of years parameter, the function
begins with reading multiple years of data using another function
(fars_read_years(years)
) included in this package.Next, the function also
uses 'dplyr' package to stack dataframes (dat_list) using (bind_rows(dat_list)
)
and group the observations of combined dataframe by year and month using
(group_by(year,MONTH)
) function, whose output is then piped for summary
dataframe using (summarize(n=n())
) function of dplyr
package. Finally,
the output is piped to organize the monthly number of observatons by year using
(spread(year,n)
) function imported from tidyr
package.
1 | fars_summarize_years(years)
|
years |
a list or vector containing year specification such as
( |
This function returns a dataframe, containing number of monthly observations for each year. The monhly observations numbers are organized under columns of years, each column representing a year.
1 2 3 4 | ## Not run:
fars_summarize_years(c(2013,2014,2015))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.