Without the data we can't give you clear answers however, given my understanding of the problem below are some methods.
- Assuming your dataset already has a column that has each bank's operating country, you could create a manual vector of the countries you are interested in and then filter the dataset for rows that match
#manually assign countries to vector (this must match how the countries are listed in your data)
euro_countries<- c("Germany","England","France","Poland")
#Then filter dataset to pull up rows that match, I make up colnames as I don't know your data
dataframe %>% filter(op_country %in% euro_countries)
- alternatively, depending on your data set you can reference the very helfpul
countrycode
library in R which has an existing dataset that can potentially join your dataset country column against the matching column in countrycode::codelist
and then reference the countrycode::codelist$continent
to filter for countries in "Europe".
#join your data set with the codelist table but depends on country column in your dataset
dataframe <- left_join(x=df,y=countrycode::codelist,by=c("op_country"="country.name.en"))
#filter your dataset with the new column
dataframe %>% filter(continent=="Europe")