This function (eq_location_clean) removes country names at the beginning of the LOCATION_NAME field.
It is assumed that country names are followed by a colon when a subsequent city name is provided.
Where only the country name is given in the LOCATION_NAME field, the country name is removed since this information is in the country field.
The removal of country names is performed using the mutate_ function from the dplyr package (
The LOCATION_NAME field is converted to title case using the str_to_title function from the stringr package (
Name of input data frame on which to apply function.
This function returns a data frame table where the LOCATION_NAME field in the earthquake data is cleansed.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.