【发布时间】:2019-09-28 22:10:59
【问题描述】:
有一个数据框:
dframe <- structure(list(id = c(1L, 1L, 1L, 1L), name = c("Amazon", "Google",
"Google", "Yahoo"), label = c("pre", "after", "pre", "after"),
text_sth = c("other", "another one test text_sth another text",
"another text other", "another one test text_sth another text"
)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-4L))
对于在每个名称中检测到的每个用户 ID,如何保留仅包含在列标签前后的行。预期输出示例:
id name label text_sth
1 Google after another one test text_sth another text
1 Google pre another text other
【问题讨论】:
-
请澄清“在每个名称中检测每个用户 ID”。您的示例数据中只有一个 id 值。
标签: r