eq_location_clean: Tidy location names field in earthquake data

Description Usage Arguments Value Examples

Description

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 (mutate_). The LOCATION_NAME field is converted to title case using the str_to_title function from the stringr package (str_to_title).

Usage

1

Arguments

data

Name of input data frame on which to apply function.

Value

This function returns a data frame table where the LOCATION_NAME field in the earthquake data is cleansed.

Examples

1
2
3
4
5
## Not run: 
eq_clean_loc <- eq_location_clean(eq_clean)
eq_clean_loc <- eq_location_clean(data= eq_clean)

## End(Not run)

drsmd23/Eq documentation built on May 14, 2019, 10:33 a.m.