diff --git a/scripts/write-output/final-output-concepts.R b/scripts/write-output/final-output-concepts.R index 075ba4f..9af8e24 100644 --- a/scripts/write-output/final-output-concepts.R +++ b/scripts/write-output/final-output-concepts.R @@ -37,6 +37,15 @@ combined_output_concepts <- bind_rows(combined_device, combined_healthkit) combined_output_concepts <- combined_output_concepts[!duplicated(combined_output_concepts), ] +valid_participants <- + read.csv(file.path(outputConceptsDir, "participant_devices.csv")) %>% + distinct(participantidentifier) %>% + pull() + +combined_output_concepts <- + combined_output_concepts %>% + filter(participantidentifier %in% valid_participants) + combined_output_concepts %>% write.csv(file.path(outputConceptsDir, "output_concepts.csv"), row.names = F) cat(glue::glue("output_concepts written to {file.path(outputConceptsDir, 'output_concepts.csv')}"),"\n")