Description Usage Arguments Details Value Examples
Checks that the country in which the location (given by the columns LATITUDE and LONGITUDE) is the same with the value from COUNTRY column. If there are differences, the value from the COUNTRY column is updated.
1 | fix_countries(dff)
|
dff |
A dataframe containing NOAA Earthquake data |
To determine the location's country, we use the coords2country function. If the function coords2country return NA, we don't update the value from the COUNTRY column.
A date frame with the values from COUNTRY corrected
1 2 3 4 5 6 7 8 9 10 | dfnew <- load_data()
dfnew <- dplyr::mutate(dfnew, LATITUDE=as.numeric(LATITUDE))
dfnew <- dplyr::mutate(dfnew, LONGITUDE=as.numeric(LONGITUDE))
dfnew <- dplyr::mutate(dfnew, EQ_PRIMARY=as.numeric(EQ_PRIMARY))
dfnew <- dplyr::mutate(dfnew, DEATHS=as.numeric(DEATHS))
dfnew <- fix_na_latitude(dfnew)
dfnew <- fix_na_longitude(dfnew)
dfnew <- fix_na_lon_na_lat(dfnew)
dfnew <- dplyr::mutate(dfnew, DataEQ=convert_data(YEAR, MONTH, DAY))
test <- fix_countries(dfnew)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.