這是繼內從Extract rows with duplicate values in two or more fields but different values in another field 至於建議,我分別張貼額外的請求。第一個代碼然後問題。 library(data.table)
# load the data
customers <- structure(list(
N
我有3列 category <- c("A", "A", "A", "B","B")
id <- c(1,1,2,3,3)
text <- c("abc", "def", "ghi", "jkl", "pqr")
df <- data.frame(category,id,text)
> df
category id text
1 A 1 abc
2 A 1 def
3 A
我的數據框有各種字符串。看樣DF: strings <- c("Average complications and higher payment",
"Average complications and average payment",
"Average complications and lower payment",
"Average mortality