eq_location_clean: Clean Earthquake Location Field

Description Usage Arguments Details Value Examples

Description

eq_location_clean takes a data frame of NOAA earthquake data and cleans the LOCATION_NAME field.

Usage

1

Arguments

data

A data frame of NOAA significant earthquake data, similar to what can be loaded with data(quakes). At a minimum, the data needs to have LOCATION_NAME and COUNTRY features to use this function.

Details

This function cleans the LOCATION_NAME observation in a NOAA Significant Earthquakes data set. It removes the country name (of form COUNTRY:) from the LOCATION_NAME data (unless the country is the only name present in that field), and converts the remainder of the field to Title Case. This will make the location name easier to read when plotting and mapping.

Value

A tbl_df with the same supplied data, but with the LOCATION_NAME variable cleaned up to remove the country name that is supplied in the COUNTRY variable (unless the country name is the only word in the LOCATION_NAME observation), and convert the remainder of the words in LOCATION_NAME to Title Case.

Examples

1
2
data(quakes)
quakes_loc_clean <- eq_location_clean(quakes)

JazminCevallos/Package-Evaluation documentation built on May 27, 2019, 12:16 p.m.