title: Select multiple columns by name in R
body: <p>I'm relatively new to R, so maybe this is really basic. But I need to select multiple columns from a data frame by name in R. I know the columns I want are all adjacent. I know the name of the first column and the last column. And in my case in particular all columns have names of the form XYYYY where 'X' is the letter X and the 'Y's are numbers representing years, but some years may be omitted (I don't know whether or not any of the years in my range are omitted just that the data set is missing some years.) Is there a way to do this that doesn't involve looping an selecting each column individually until I get to the last one?</p>