我有一个dataframe,看起来像这样:
example <- data.frame(
Partner.A.s.ID = c(1101, 1102),
Partner.A.s.name = c("X", "A"),
Partner.B.s.ID = c(2101, 2102),
Partner.B.s.name = c("Y", "B"),
Partner.A.s.email = c("XXX", "AAA"),
Partner.B.s.email = c("YYY", "BBB")
)
字符串
我如何按组(即(A和B)?这是所需的输出:
example_solution <- data.frame(
Partner.ID = c(1101, 1102, 2101, 2102),
Partner.name = c('X', 'A', 'Y', 'B'),
Partner.email = c("XXX", "AAA", "YYY", "BBB")
)
型
谢谢你,谢谢
1条答案
按热度按时间wgx48brx1#
字符串
创建于2023-07-21使用reprex v2.0.2