-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5870d03
commit 2474219
Showing
6 changed files
with
1,584 additions
and
59 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#' Is Climatic Element | ||
#' @description | ||
#' Check if the column name is a climatic element. | ||
#' | ||
#' @param x Character, the name of the column. | ||
#' | ||
#' @return Logical, TRUE if the column is a climatic element, FALSE otherwise. | ||
is_climatic_element = function(x) { | ||
return(x %in% c(rain_label, rain_day_label, rain_day_lag_label, temp_min_label, temp_max_label, temp_air_label, | ||
temp_range_label, wet_buld_label, dry_bulb_label, evaporation_label, capacity_label, wind_speed_label, | ||
wind_direction_label, sunshine_hours_label, radiation_label, cloud_cover_label)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#' Standardise Country Names | ||
#' @description | ||
#' Standardise country names in the dataset. | ||
#' | ||
#' @param country Name of Country | ||
#' | ||
#' @return Name of country | ||
standardise_country_names = function(country) { | ||
country_names <- country | ||
country_names[country_names == "Antigua and Bar"] <- "Antigua and Barbuda" | ||
country_names[country_names == "Bosnia and Herz"] <- "Bosnia and Herzegovina" | ||
country_names[country_names == "Cabo Verde"] <- "Cape Verde" | ||
country_names[country_names == "Central African"] <- "Central African Republic" | ||
country_names[country_names == "Cote d'Ivoire"] <- "Cote d'Ivoire" | ||
country_names[country_names == "Congo, Democrat"] <- "Democratic Republic of the Congo" | ||
country_names[country_names == "Dominican Repub"] <- "Dominican Republic" | ||
country_names[country_names == "Egypt, Arab Rep"] <- "Egypt" | ||
country_names[country_names == "Equatorial Guin"] <- "Equatorial Guinea" | ||
country_names[country_names == "Gambia, The"] <- "Gambia" | ||
country_names[country_names == "Iran, Islamic R"] <- "Iran, Islamic Republic of" | ||
country_names[country_names == "Korea, Republic"] <- "Korea, Republic of" | ||
country_names[country_names == "Kyrgyz Republic"] <- "Kyrgyzstan" | ||
country_names[country_names == "Lao People's De"] <- "Lao People's Democratic Republic" | ||
country_names[country_names == "Macedonia, form"] <- "Macedonia, the Former Yugoslav Republic of" | ||
country_names[country_names == "Moldova"] <- "Moldova, Republic of" | ||
country_names[country_names == "Papua New Guine"] <- "Papua New Guinea" | ||
country_names[country_names == "Russian Federat"] <- "Russian Federation" | ||
country_names[country_names == "St. Kitts and N"] <- "Saint Kitts and Nevis" | ||
country_names[country_names == "St. Lucia"] <- "Saint Lucia" | ||
country_names[country_names == "St. Vincent and"] <- "Saint Vincent and the Grenadines" | ||
country_names[country_names == "Sao Tome and Pr"] <- "Sao Tome and Principe" | ||
country_names[country_names == "Slovak Republic"] <- "Slovakia" | ||
country_names[country_names == "Syrian Arab Rep"] <- "Syrian Arab Republic" | ||
country_names[country_names == "Trinidad and To"] <- "Trinidad and Tobago" | ||
country_names[country_names == "Tanzania"] <- "United Republic of Tanzania" | ||
country_names[country_names == "Venezuela, Repu"] <- "Venezuela" | ||
country_names[country_names == "Vietnam"] <- "Viet Nam" | ||
country_names[country_names == "West Bank and G"] <- "West Bank and Gaza" | ||
country_names[country_names == "Yemen, Republic"] <- "Yemen" | ||
return(country_names) | ||
} |
Oops, something went wrong.