for example there is data which have X,Y,M. To select column of X I made this function
#data
da<-data.frame(x,y,m,coco)
#function