Skip to content

Commit

Permalink
add note
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 6, 2023
1 parent 2e0ccf3 commit 4d4ca51
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion R/dedup.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,23 @@ dedup_faers_ascii <- function(data, deleted_cases = NULL) {
order = c(-1L, -1L, -1L, -1L, 1L, -1L)
)
out <- unique(out, by = "caseid")

# test code
# Following codes are based on
# https://stackoverflow.com/questions/69366291/copy-only-one-variable-from-one-r-data-table-to-another-after-matching-on-a-vari
# which should be memory efficient
# a <- data.table::data.table(
# id = rep(letters[1:2], 5),
# var1 = rnorm(10)
# )
# b <- data.table::data.table(
# id = letters,
# var2 = rnorm(length(letters))
# )
# b[a[, paste0(var1, collapse = "/"), by = "id"],
# var1 := V1,
# on = "id"
# ]
# b
# collapse all used drugs, indi, ther states, use it as a whole to identify
# same cases.
# match drug, indi, and ther data.
Expand Down

0 comments on commit 4d4ca51

Please sign in to comment.