eq_clean_data: Clean NOAA earthquake data

Description Usage Arguments Details Value References Examples

Description

eq_clean_data cleans the NOAA earthquake data from the website and returns a data frame for use in analysis and visualization. A column DATE is created from YEAR, MONTH and DAY values. Numeric fields are set to be numeric, for example the different earthquake magnitude values.

Usage

1

Arguments

indf

is the raw NOAA data frame as read from the web site - a link to the data source and to the data descriptions can be found below in the refereces

Details

The DATE column is created from the YEAR, MONTH and DAY values (which are removed). If only the YEAR is supplied, the date is set to be 1 January for that year. Note that some dates may have a negative year value indicating a B.C.E date.

Value

the cleaned data frame

References

The NOAA earthquake database https://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1 and the data defintions can be found at https://www.ngdc.noaa.gov/nndc/struts/results?&t=101650&s=225&d=225

Examples

1
2
3
4
5
6
7
## Not run: 
readr::read_delim("earthquakes.tsv.gz", delim = "\t") %>%                #read the data file
  eq_clean_data() %>%                                                    #clean the data
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000) %>% #select for analysis
  eq_map(annot_col = "DATE")                                             #map the locations

## End(Not run)

jrwalker-projects/quaker documentation built on May 23, 2019, 7:33 a.m.