Creating vectors in R : <p>I have what I think is a trivial problem in R that I would be most grateful for some assistance with:</p>

<p>I am trying to select a large number of variables (>1000) from a dataframe. The variables are grouped in bundles together</p>

<p>I have a vector containing the start position of the variables eg. c(74, 240, 5678, 20000). 
I also have a vector containing the end positions e.g. c(80, 267, 5679, 20200). 
I am unsure of how to generate from these a vector that I could use to select the desired variables: e.g. c(74:80, 240:267, 5678:5679, 20000:20200). </p>

<p>I would be most grateful for any advice</p>

<p>Thanks</p>

<p>Rob</p>
