#' @title Extracts data for a specific variable from a data set.
#' @description Extracts data for specific variable from a data set. Default is the Entrances data set.
#'
#' @param VarName character string or vector with character strings with the name(s) of the variable(s).
#' @param data dataframe, from which you want to extract your data. The data frame must contain a column called variable. Default is the EntrancesData data set.
#' @return dataframe
#' @export
#' @examples
#' #extracts data for a specific variable from a data frame. Default is the EntrancesData data set.
#' get_data_for_variable(VarName="GDP_EUR", data=EntrancesData)
get_data_for_variable<- function(VarName, data=EntrancesData){
dataout<-data[which(data$variable %in% VarName),]
return(dataout)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.