#' @title NUTS IDs of a region
#' @description Return all NUTS IDs of a region of the ENTRANCES case studies.
#'
#' @param regions string or character vector, containing the name(s) of the region(s), you want to extract the NUTS IDs for.
#' @return vector with NUTS IDs
#' @export
#' @examples
#' #get NUTS IDs for a region or several regions
#' get_nuts_ids_for_region(regions="Lusatia")
#' get_nuts_ids_for_region(regions=c("Lusatia", "Central Germany", "Rhineland"))
get_nuts_ids_for_region<- function(regions){
for (region in 1:length(regions)){
regions[region]<-tolower(regions[region])
regions[region]<-stringr::str_replace_all(regions, " ", "")[region]
}
NUTS=unique(EntrancesData$NUTS_ID[which(EntrancesData$region %in% regions & EntrancesData$NUTS_ID %in% NUTS_data$NUTS)])
return(NUTS)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.