【发布时间】:2021-05-05 01:09:57
【问题描述】:
目标:过滤数据集中的行,以便只保留不同的单词 目前,我使用inner_join 保留 2 个数据集中的行,这使我在这个数据集中的行重复。
尝试 1:我尝试使用distinct 仅保留那些唯一的行,但这没有奏效。我可能用错了。
# join warriner emotion lemmas by `word` column in collocations data frame to see how many word matches there are
warriner2 <- dplyr::inner_join(warriner, coll, by = "word") # join data; retain only rows in both sets (works both ways)
warriner2 <- distinct(warriner2)
warriner2
coll2 <- dplyr::semi_join(coll, warriner, by = "word") # join all rows in a that have a match in b
# There are 8166 lemma matches (including double-ups)
# There are XXX unique lemma matches
【问题讨论】:
-
图片不是共享数据/代码的正确方式。以更易于复制的可复制格式添加它们。阅读how to give a reproducible example。
标签: r data-wrangling