Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 R 中,我有一个 1 行表。如何将其转换为矢量?
具体来说,表格是这样的:
0 1 2 3 4 21 35 46 62 36
我试过括号符号,但无济于事!
或者你可以使用as.vector(x)
as.vector(x)
它已经是一个向量。
tbl <- table(rpois(100, 10)) tbl[1] tbl[2:5] tbl[tbl > 10]
如果表名为 x,则只需使用 c(x)。