Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- structure(list(Case.Number = c("127967", "127967", "127967",
- "127967", "141330", "141330", "141330", "141330", "141240", "141240",
- "141240"), Word = c("account", "want", "membership", "sort",
- "unhappi", "vr", "info", "miss", "csrf", "unhappi", "dissatisfi"
- )), .Names = c("Case.Number", "Word"), class = c("data.table",
- "data.frame"), row.names = c(NA, -11L), .internal.selfref = <pointer:
- 0x0000000000120788>)
- 127967 account want
- 127967 account membership
- 127967 account sort
- 127967 want membership
- 127967 want sort
- 141330 unhappi vr
- 141330 unhappi info...
- excluding
- 141330 unhappi unhappi
- source <- c("remove")
- target <- c("remove")
- ID <- c("remove")
- df <- data.frame(ID = c("remove"), source = c("remove"), target = c("remove"))
- for(i in unique(tbl$Case.Number)){
- for (r in grep(i, tbl$Case.Number)) {
- if(r < max(grep(i, tbl$Case.Number))){
- ID <- i
- source <- tbl$Word[r]
- target <- tbl$Word[r+1]
- rbind(df, cbind(ID, source,target))
- }
- }
- }
- View(df)
Add Comment
Please, Sign In to add comment