Skip to content

Commit

Permalink
Update match.R
Browse files Browse the repository at this point in the history
Do not need to write distinct ids. The previous code already does that.
  • Loading branch information
SapanTiwari authored Apr 23, 2024
1 parent 423a3b9 commit 8aa653d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions R/match.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ matchPersons<-function(filters, censuscsv, outcsv_prefix) {
gender <- if(filters[row,]$sex=="M") "Male" else "Female"
cohort <- orig %>%
filter(Age >= filters[row,]$age_start & Age <= filters[row,]$age_end & Gender == gender)
# Get unique AgentIds for the group to avoid duplicates
cohort <- cohort %>%
dplyr::distinct(AgentId, .keep_all = TRUE)
outfile <- paste0(outcsv_prefix,filters[row,]$cluster_id_5,".csv")
echo(paste0('Appending to ',outfile,'\n'))
write.table(cohort, outfile, row.names=FALSE, col.names=FALSE, quote=TRUE, sep=",", append=TRUE)
Expand Down

0 comments on commit 8aa653d

Please sign in to comment.