library(toolsEarthquakes)

This is a brief document about how to use the toolsEarthquakes package. This package includes tools for cleaning and ploting data from The Significant Earthquake Database.
It is important to highlight that the all the functions are only useful for this kind data or another with similar structure and information.

Cleaning functions

The cleaning functions included in this package are eq_clean_data and eq_location_clean. Both works with data from The Significant Earthquake Database (see the link above). Too view an example of this kind of data, type Earthquakes and ?Earthquakes after installing and loading this package.

eq_clean_data

This function produce a data frame with the following information:

Type ?eq_clean_data for more details and/or cleanES_1 to see an example of the output produced by this function.

clean_1 <- eq_clean_data(data = Earthquakes)
head(clean_1)

The DATE column looks like this:

head(clean_1$DATE)

This function has the r.na argument. By default r.na = TRUE, what it removes all columns where MONTH and DAY have NA values. Otherwise, the function keeps them and replaces the NA's by 1.

clean_2 <- eq_clean_data(data = Earthquakes, r.na = FALSE)
head(clean_2$DATE)

eq_location_clean

This function transforms the LOCATION_NAME column in a given dataset, by stripping out the country name (including the colon) and converts names to title case (as opposed to all caps).
Type ?eq_location_data for more details and/or cleanES_3 to see an example of the output produced by this function.

clean_3 <- eq_location_clean(data = Earthquakes)
head(clean_3$LOCATION_NAME)


Juanin2691/toolsEarthquakes documentation built on May 28, 2019, 5:41 p.m.