eq_clean_data: Clean the raw NOAA earthquake data to interface well with the...

Description Usage Arguments Details Value Examples

View source: R/cleandata.R

Description

Clean the raw NOAA earthquake data to interface well with the other functions in this package The NOAA earthquake database that is included with this package is already clean and ready to use with the other functions. However, that data is frozenas of July 1, 2017. More up-to-date data can be cleaned up using this function

Usage

1
eq_clean_data(raw_data)

Arguments

raw_data

A data frame containing the raw NOAA earthquake data. The function assumes the data has been read in using readr::read_delim with the option delim = '\t'

Details

The raw data is available here The data cleanup does the following: 1. create DATE, and make sure it is date class 2. make sure LONGITUDE and LATTITUDE are numeric; drop NA lat/lon 3. clean location name 4. make sure magnatude measures are numeric 5. make sure deaths are numeric

Value

A data frame of cleaned data, ready to be used in the visualization functions included in this package

Examples

1
2
3
4
5
6
# assumes the raw NOAA Significant Earthquake Database is available in
# your working directory as 'raw_NOAA.txt'
## Not run: 
clean_NOAA <- eq_clean_data(readr::read_delim('raw_NOAA.txt', delim = '\\t'))

## End(Not run)

gravatarsmiley/capstoneR documentation built on May 30, 2019, 4:06 a.m.