eq_location_clean: eq_location_clean

Description Usage Arguments Details Value Examples

View source: R/earthquake.R

Description

Takes the raw data set and modified the column LOCATION_NAME to strip out country names and reformats to title case. This is recommended before passing the data into the "_label" functions to improve presentation of the output. The function can be used in conjuntion with 'eq_clean_data' either before or after it in a

Usage

1

Arguments

eq_data

A data table containing NOAA Earthquake data

Details

A regular expression is used to match and remove the country names.

Value

A date frame with LOCATION_NAME cleaned to have country names removed and text in title case.

Examples

1
2
3
4
5
library(dplyr)
USA_clean_loc <- eq_clean_data(eq_data_raw) %>%
  eq_location_clean() %>% dplyr::filter(COUNTRY %in% "USA")
USA_IRAN_clean_loc <- eq_clean_data(eq_data_raw) %>%
   eq_location_clean() %>% dplyr::filter(COUNTRY %in% c("USA","IRAN"))

Moonglum8/rEarthquake documentation built on July 17, 2020, 5:10 p.m.