eq_get_data: Read in Data

Description Usage Arguments Details Value Examples

View source: R/get_data.R

Description

This function takes a country name in all capitals, a start date as a string in 'YYYY-MM-DD' format, and optionally an end date in the same format, read in the earthquake data, cleans it, and turns a filtered cleaned dataframe.

Usage

1
2
eq_get_data(filename = system.file("extdata", "earthquakes.tsv.gz",
  package = "NOAA"), country, start_date, end_date = lubridate::today())

Arguments

filename

Name of file to read in. Defaults to 'earthquakes.tsv.gz' data contained internally in package.

country

A country name in all capital letters as a sting, eg. 'MEXICO', or a vector of country names, eg. c('MEXICO','USA')

start_date

A date as a string in 'YYYY-MM-DD' format to filter observations for

end_date

An optional paramater, a date as a string in 'YYYY-MM-DD' format to filter observations for. Defaults to todays date if not overridden.

Details

This function reads in an earthquake dataset provided with the package, cleans and formats the data, then filters for a country or countries, then returns a tbl_df data.frame

Value

tbl_df data.frame

Examples

1
2
## Not run: eq_get_data(country = c('MEXICO','USA'), start_date = '2001-01-01', end_date = '2003-01-01')
## Not run: eq_get_data(country = 'MEXICO', start_date = '2001-01-01')

ctaber/NOAA documentation built on Nov. 4, 2019, 9:19 a.m.