You can use with( ) from base R or the exposition pipe, %$%, from the magrittr package. They will let the mean( ) function look in the piped data.frame for the variable.
library(magrittr)
example <- data.frame (var1 = c ("ITA", "AUT", "POR", "USA"),
var2 = c(1, 5, NA, 16))
example %>% with(mean(var2, na.rm = TRUE))
#> [1] 7.333333
example %$% mean(var2, na.rm = TRUE)
#> [1] 7.333333