Skip to content

Commit

Permalink
leave NA at last for we want to keep the first row
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 7, 2023
1 parent 6fbd7a2 commit e5b00a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/dedup.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ dedup_faers_ascii <- function(data, deleted_cases = NULL) {
cols = c(
"year", "quarter", "caseversion", "fda_dt", "i_f_code", "event_dt"
),
order = c(-1L, -1L, -1L, -1L, 1L, -1L)
order = c(-1L, -1L, -1L, -1L, 1L, -1L), na.last = TRUE
)
out <- unique(out, by = "caseid")
# test code
Expand Down Expand Up @@ -297,6 +297,7 @@ dedup_faers_ascii <- function(data, deleted_cases = NULL) {
# 6 unique5 191.8µs 203.7µs 4704. 52.6KB 47.5 99

for (i in seq_along(can_be_ignored_columns)) {
# NAs are always first for `setkeyv`
data.table::setkeyv(out, cols = common_keys)
out <- unique(out,
fromLast = TRUE,
Expand Down

0 comments on commit e5b00a4

Please sign in to comment.