R classを保持しながらデータフレームから特定列を抽出する方法 drop=F

Reference - https://twitter.com/R_Programming/status/631827554689650688
> x<-seq(1,10,by=1)
> y<-rnorm(10)
> df<-data.frame(x,y)
> df
    x           y
1   1  0.91897737
2   2  0.78213630
3   3  0.07456498
4   4 -1.98935170
5   5  0.61982575
6   6 -0.05612874
7   7 -0.15579551
8   8 -1.47075238
9   9 -0.47815006
10 10  0.41794156
> class(df)
[1] "data.frame"
> df[,1]
 [1]  1  2  3  4  5  6  7  8  9 10
> class(df[,1])
[1] "numeric"
> df[,1,drop=F]
    x
1   1
2   2
3   3
4   4
5   5
6   6
7   7
8   8
9   9
10 10
> class(df[,1,drop=F])
[1] "data.frame"
> df[,2,drop=F]
             y
1   0.91897737
2   0.78213630
3   0.07456498
4  -1.98935170
5   0.61982575
6  -0.05612874
7  -0.15579551
8  -1.47075238
9  -0.47815006
10  0.41794156
> class(df[,2,drop=F])
[1] "data.frame"