eq_read_data: Reads in the raw data taken from the NCEI/WDS database....

Description Usage Arguments Value Examples

View source: R/data_cleaning.R

Description

Reads in the raw data taken from the NCEI/WDS database. Expect tab-separated data with column names: Year, Mo, Dy, Hr, Mn, Sec, Tsu, Vol, and "Location Name". Renames some columns, drops some irrelevant columns and converts all column names to uppercase.

Usage

1
2
3
4
eq_read_data(
  filename = system.file("extdata", "earthquakes-2021-03-08_17-02-58_-0500.tsv",
    package = "earthquakes")
)

Arguments

filename

a path to a file, a connection, or literal data (either a single string or a raw vector).

Value

dataframe

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

# Retrieve all earthquake data from 2020
data <- eq_read_data() %>%
           dplyr::filter(YEAR == 2020) %>%
           dplyr::select(DATE, YEAR, COUNTRY, REGION, LONGITUDE, LATITUDE, MAG, TOTAL_DEATHS) %>%
           tidyr::drop_na()

## End(Not run)

rsizem2/noaa-earthquakes documentation built on Dec. 22, 2021, 7:17 p.m.