R/get_data_nuts3.R

Defines functions get_data_NUTS3

Documented in get_data_NUTS3

#' @title Extracts data on the NUTS3-level of a data set.
#' @description Extracts all observations/rows which are on the NUTS3-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 NUTS3 level from a data set. Default is the EntrancesData data set.
#' get_data_NUTS3(data=EntrancesData)
get_data_NUTS3<-function(data=EntrancesData) {
  NUTS3<-NUTS_data$NUTS[which(nchar(NUTS_data$NUTS)==5)]
  dataout<-data[which(data[,1] %in% NUTS3),]
  return(dataout)
}
THartl1/EntrancesDataPackage documentation built on Dec. 18, 2021, 4:01 p.m.