#' @title Extracts data on the country level (NUTS) of a data set.
#' @description Extracts all observations/rows which are on the NUTS country level from a data set. Default is the Entrances data set.
#'
#' @param data dataframe, from which you want to extract your data. The data frame must contain the regional IDs in the first column. Default is the EntrancesData data set.
#' @return dataframe containing only observations with NUTS3_IDs
#' @export
#' @examples
#' #extracts data only for the national NUTS level from a data set. Default is the EntrancesData data set.
#' get_data_NUTS_country(data=EntrancesData)
get_data_NUTS_country<-function(data=EntrancesData) {
NUTS_country<-NUTS_data$NUTS[which(nchar(NUTS_data$NUTS)==2)]
dataout<-data[which(data[,1] %in% NUTS_country),]
return(dataout)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.