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.
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.
This function produce a data frame with the following information:
A date column created by uniting the year, month, day and converting it to the Date class.
LATITUDE and LONGITUDE columns converted to numeric class.
Any other column in the original data frame, except MONTH, YEAR, DAY, HOUR, MINUTE and SECOND.
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)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.