I would like to incorporate variable names that imply what I should do with them. I imagine a dataframe \"survey\".
library(Rlab) # Needed for rbern() functi
You can use grep() with colnames():
grep()
colnames()
survey[,grep("bern", colnames(survey))]