eq_location_clean: Cleans the location name of the raw NOAA earthquake dataset.

Description Usage Arguments Value Examples

View source: R/eq_location_clean.R

Description

Cleans the (LOCATION_NAME) column by stripping out the country name (including the colon) and converts names to title case (as opposed to all caps). This will be needed later for annotating visualizations. This function should be applied to the raw data to produce a cleaned up version of the (LOCATION_NAME) column.

Usage

1

Arguments

eq_datf

the raw NOAA earthquake dataset as a data frame that contains location names written in upper case.

Value

returns a clean data frame of the NOAA earthquake dataset.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
filename <- system.file("extdata", "signif.txt", package = "earthquakes")
library(readr)
eq_data_raw <- readr::read_delim(file = filename, delim = "\t")
eq_data <- eq_location_clean(eq_datf = eq_data_raw)
head(eq_data_raw$LOCATION_NAME)
head(eq_data$LOCATION_NAME)

## End(Not run)

raggichr/earthquakes documentation built on June 25, 2020, 5:45 p.m.