eq_clean_data: Clean earthquake data

Description Usage Arguments Value Examples

View source: R/eq_clean_data.R

Description

eq_clean_data takes a NOAA data frame and returns a cleaned data.frame. The clean data.frame contains a date column, of type Date, created by uniting the year, month and day columns from the given, raw data. The LATITUDE and LONGITUDE are converted to numeric types.

Usage

1
eq_clean_data(raw_data)

Arguments

raw_data

is a NOAA data.frame in the format supplied by NOAA (see https://www.ngdc.noaa.gov/nndc/struts/form?t=101650&s=1&d=1) The data.frame should contain the following columns

  • "LATITUDE"

  • "LONGITUDE"

  • "SECOND"

  • "MINUTE"

  • "HOUR"

  • "DAY"

  • "MONTH"

Value

a data.frame containing the cleaned data.

Examples

1
2
3
4
5
6
7
library(data.table)
library(magrittr)
library(quake)

data_file_name <- system.file("extdata", "earthquakes.tsv", package = "quake")
clean_data     <- fread(data_file_name) %>% eq_clean_data
clean_data

RussellPolitzky/quake documentation built on May 23, 2019, 10:35 p.m.