# Required Packages -------------------------------------------------------
library(tidyverse) # Data Wrangling
# Data Wrangling Section --------------------------------------------------
# This function merge dates information and change the latitude and longitude to numeric
eq_clean_data <- function(rawData){
readr::read_delim(rawData, delim = "\t") %>%
mutate(dates = lubridate::dmy(paste0(DAY,"-", MONTH,"-", YEAR))) %>%
mutate(LATITUDE = as.numeric(LATITUDE),
LONGITUDE = as.numeric(LONGITUDE))
}
# This function cleans out the Location Name character so it only shows the city or locations
eq_location_clean <- function(rawData){
rawData %>%
dplyr::mutate(LOCATION_NAME = LOCATION_NAME %>%
stringr::str_replace(paste0(COUNTRY, ":"), "") %>%
stringr::str_trim("both") %>%
stringr::str_to_title())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.