here is my function defintion
get_df <- function(c_code) {
df %>%
filter(
country_code == c_code
)
}
following is my sample dataframe
x<- c("abc", "USA", "ghi", "jkl")
y<- c("bnj", "GBR", "sfd", "lai")
df <- data.frame(rbind(x, y))
colnames(df) <- c("p", "country_code", "q", "r")
using lapply("USA", get_df)
gives following output with ÿþ encoding