将矩阵(或表)转换为表格列表?
我想将数据集转换为表列表(我不知道它叫什么),但这是一个示例(显然,初始数据集更大得多)。 初始数据:
Station | SP1 | SP2 | SP3 |
---|---|---|---|
2 | 0 | 1 | 1 |
10 | 0 | 3 | 0 |
34 | 0 | 0 | 0 0 |
53 | 0 | 3 | 5 |
56 | 6 | 0 | 3 |
57 | 1 | 0 | 0 0 |
62 | 1 | 8 | 10 |
和我想要的:
谢谢
I want to transform my dataset into a table-list (I don't know what it's called) but here's an example (obviously the initial dataset is much larger).
initial data :
station | SP1 | SP2 | SP3 |
---|---|---|---|
2 | 0 | 1 | 1 |
10 | 0 | 3 | 0 |
34 | 0 | 0 | 0 |
53 | 0 | 3 | 5 |
56 | 6 | 0 | 3 |
57 | 1 | 0 | 0 |
62 | 1 | 8 | 10 |
and what I would like :
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
推断您不需要
0
行,这只是一个枢轴/过滤器2步。基本R和reshape2
dplyr
data.table
(实际上与
reshape2
。)数据
Inferring that you don't want
0
rows, this is just a pivot/filter 2-step.base R and reshape2
dplyr
data.table
(Effectively the same as
reshape2
.)Data