Skip to content

Commit

Permalink
Further speeding up creation of reference table
Browse files Browse the repository at this point in the history
  • Loading branch information
Admin_mschuemi authored and Admin_mschuemi committed Nov 2, 2023
1 parent 5886fb1 commit bcd6320
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ Imports:
checkmate,
readr,
ResultModelManager,
zip
zip,
jsonlite
Suggests:
testthat,
knitr,
Expand Down
10 changes: 5 additions & 5 deletions R/RunAnalyses.R
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,16 @@ createReferenceTable <- function(sccsAnalysisList,
)
)
}

# Compute unions of concept sets
uniqueLoads <- unique(loads)
loadStrings <- sapply(loads, jsonlite::toJSON)
uniqueLoadStrings <- unique(loadStrings)
referenceTable$sccsDataFile <- ""
referenceTable$loadId <- NA
loadConceptsPerLoad <- list()
for (loadId in seq_along(uniqueLoads)) {
uniqueLoad <- uniqueLoads[[loadId]]
for (loadId in seq_along(uniqueLoadStrings)) {
uniqueLoadString <- uniqueLoadStrings[[loadId]]
# groupables <- ParallelLogger::matchInList(instantiatedArgsPerRow, uniqueLoad)
rowIds <- which(sapply(loads, function(x) isTRUE(all.equal(uniqueLoad, x))))
rowIds <- which(loadStrings == uniqueLoadString)
groupables <-instantiatedArgsPerRow[rowIds]
outcomeIds <- unique(unlist(ParallelLogger::selectFromList(groupables, "outcomeId")))
exposureIds <- lapply(groupables, function(x) x$exposureIds)
Expand Down

0 comments on commit bcd6320

Please sign in to comment.