 <p>Or using @Brandon Bertelsen's example data</p> <pre><code>dat1 &lt;- transform(dat[grep("^\\d+$", dat$A),,drop=F], A= as.numeric(as.character(A))) dat1 # A #6 1 #7 2 #8 3 #9 4 #10 5 str(dat1) #'data.frame': 5 obs. of 1 variable: #$ A: num 1 2 3 4 5 </code></pre>