eq_clean_data: clean naoo data contained in data.frame

Description Usage Arguments Value Note Examples

View source: R/eq_clean_data.R

Description

this function expects a data.frame containing the columns detailed below. It will create a dataframe containing - a new LOCATION column containing the cleaned data from the LOCATION_NAME column - a new DATE column in date format from the YEAR, MONTH and DAY info - latitude, longitude and all columns starting with TOTAL_* to numeric format

Usage

1

Arguments

df

a data.frame containing columns named in note below

Value

data.frame containing the (reformatted) columns described above

Note

the columns are: I_D: the ID of the event given by the naoo FLAG_TSUNAMI: if the event gave rise to a tsunami YEAR: the year of the event MONTH: the month of the event DAY: the day of the event FOCAL_DEPTH: the depth of the event EQ_PRIMARY: the size of the event oin the Richter scale INTENSITY: the intensity of the event on the ... scale COUNTRY: the country of the event STATE: the state in the country of the event LOCATION_NAME: the location description of the event LATITUDE: the latitude of the event LONGITUDE: the longitude of the event TOTAL_DEATHS: total number of deaths from the event TOTAL_MISSING: total number of missing from the event TOTAL_INJURIES: total number of injured from the event TOTAL_DAMAGE_MILLIONS_DOLLARS: total amount of damages from the event TOTAL_HOUSES_DESTROYED: total number of houses destroyed by the event TOTAL_HOUSES_DAMAGED: total number of houses damaged by the event

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(readr)
#get earthquake data (tab-delimited txt file) from noaa website into a tibble
eq_data_file <- paste0("https://www.ngdc.noaa.gov/nndc/struts/",
                       "results?type_0=Exact&query_0=$ID&",
                       "t=101650&s=13&d=189&dfn=signif.txt")
eq_data <- readr::read_delim(eq_data_file, delim = "\t")
eq_data_clean <- eq_clean_data(eq_data)

## End(Not run)

RMHoek/NOAAearthquakeAnalysis documentation built on May 14, 2019, 8:58 a.m.