Description Usage Arguments Details Value References Examples
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.
1 | eq_clean_data(indf)
|
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 |
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.
the cleaned data frame
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.