knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width=8,
  fig.height=5
)

The earthquakes library allows users to-

eq_clean_data

  1. Constructs date from YEAR, MONTH, DAY (defaults NA to 1 for MONTH and DAY and excludes BCE events)
  2. Sets Latitude and Longitude as numbers (doubles) for use by mapping libraries
  3. Extracts city name from full LOCATION_NAME value and format as Full Title Case
library(earthquakes)
library(dplyr)
data <- eq_clean_data(raw)
summary(data[c('DATE','LONGITUDE','LATITUDE','LOCATION_CITY')])

head(data[,c('DATE','LONGITUDE','LATITUDE','LOCATION_CITY')])

eq_clean_location

  1. eq_clean_data passes COUNTRY and LOCATION_NAME like "ITALY: POMPEI"
  2. Country and colon are removed
  3. Full Title Case applied
example_country <- "ITALY"
example_location <- "ITALY: POMPEI"
clean_location <- eq_location_clean(example_country, example_location)
clean_location

geom_timeline()

test_g <- geom_timeline(data, "2000-01-01", "2018-01-01", "NEW ZEALAND")
test_g

geom_timeline()

test_g <- geom_timeline_label(data, "2000-01-01", "2018-01-01", "NEW ZEALAND",7)
test_g

eq_map(data, annot_col)

test_m <- eq_clean_data(raw) %>%
  dplyr::filter(COUNTRY == "MEXICO" & lubridate::year(DATE) >= 2000)
eq_map(test_m, "DATE")


aliciatb/earthquakes documentation built on May 29, 2019, 11:02 p.m.