我有一个数据框如下:
gous <- structure(list(V1 = c(0, 28.44), V2 = c(1, 28.44), V3 = c(2,
28.44), V4 = c(3, 28.39), V5 = c(4, 28.22), V6 = c(5, 27.72),
V7 = c(6, 24.56), V8 = c(7, 18.78), V9 = c(8, 18.5), V10 = c(9,
18.56), V11 = c(10, 18.5), V12 = c(11, 18.72)), .Names = c("V1",
"V2", "V3", "V4", "V5", "V6", "V7", "V8", "V9", "V10", "V11",
"V12"), class = "data.frame", row.names = c(NA, -2L))
数据如下:
> gous
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12
1 0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.0 9.00 10.0 11.00
2 28.44 28.44 28.44 28.39 28.22 27.72 24.56 18.78 18.5 18.56 18.5 18.72
我想将数据转换为以下内容:
0
1
2
3
4
5
6
7
8
9
10
11
28.44
28.44
28.44
28.39
28.22
27.72
24.56
18.78
18.5
18.56
18.5
18.72
我尝试了什么:我尝试将两行数据分成单独的向量,如下所示:
gous1 <- as.numeric(gous[1,])
gous2 <- as.numeric(gous[2,])
但我无法结合使用rbind
or cbind
。我在这里看到的功能是什么?