Description Usage Arguments Details Value Examples
eq_clean_data
takes a data frame of NOAA earthquake data and cleans it
up for further analysis.
1 |
data |
A data frame of NOAA significant earthquake data, similar to what
can be loaded with |
This function takes a data frame of NOAA earthquake data, which may be
obtained from NOAA's
Significant
EarthQuake Database, or loaded into the envirnoment with data(quakes)
(April 1, 2017 snapshot), and cleans it up for further analysis. In
particular, it creates a DATE
feature by combing the YEAR
,
MONTH
, and DAY
features, and makes sure the LATITUDE
and
LONGITUDE
features are of type numeric
. Also converts the
DEATHS
, TOTAL_DEATHS
, and EQ_PRIMARY
(Richter scale
value) to type numeric
.
For the DATE
variable, note that R does not handle years before 1CE
correctly (see documentation for as.Date
). This function
has attempted to make an approximation of those dates, but the user should
handle with care. Also, for some events the month and day are not available,
so those are approximated by January and 01, respectively.
A tbl_df
with the same supplied data, but with
LATITUDE
, LONGITUDE
, DEATHS
, TOTAL_DEATHS
, and
EQ_PRIMARY
converted from character
to numeric
, and a
new column DATE
.
1 2 | data(quakes)
quakes_clean <- eq_clean_data(quakes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.