In R, when I select only one column from a data frame/matrix, the result will become a vector and lost the column names, how can I keep the column names?
For example, if I run the following code, 

```
x <- matrix(1,3,3)
colnames(x) <- c("test1","test2","test3")
x[,1]

```

I will get

```
[1] 1 1 1

```

Actually, I want to get

```
     test1
[1,]     1
[2,]     1
[3,]     1

```

The following code give me exactly what I want, however, is there any easier way to do this?

```
x <- matrix(1,3,3)
colnames(x) <- c("test1","test2","test3")
y <- as.matrix(x[,1])
colnames(y) <- colnames(x)[1]
y

```