This function (eq_clean_data) removes unnecessary columns using the select_ function from the dplyr package (
The columns that are kept in the data are: YEAR, MONTH, DAY, LATITUDE, LONGITUDE, LOCATION_NAME, TOTAL_DEATHS, COUNTRY, EQ_PRIMARY.
Earthquakes with negative year values are excluded from the data using the filter_ function from the dplyr package (
The mutate_ function from the dplyr package (
mutate_) is used to create a date column and ensure analysis columns are numeric.
Name of input data frame on which to apply function.
This function returns a data frame table containing a cleansed subset of the earthquake data.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.