Description Usage Arguments Value Examples
eq_clean_data
performs a series of edits to clean the earthquake
data. It converts the SECOND variable to a numeric type and rounds the
decimal to the nearest whole number, replaces missing values in the MONTH and
DAY variables with '1' and missing values in the HOUR, MINUTE and SECOND
variables with '0'. It uses the YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND
variables to create a new DATE variable that contains the date of an event.
It converts the LATITUDE and LONGITUDE variables to a numeric type, renames the
I_D variable to ID, changes the FLAG_TSUNAMI variable to a logical value,
and changes the EQ_PRIMARY variable from a character to a numeric type.
Finally, it filters the dataset to remove observations with missing values in
the DATE, EQ_PRIMARY and TOTAL_DEATHS variables.
1 |
df |
A data frame containing the earthquake data. |
A data frame containing the cleaned earthquake data. If an error or warning occurs, a message will be printed to the console and the function will return NULL.
1 2 3 4 | ## Not run:
earthquakes <- eq_clean_data(earthquakes)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.