Skip to content

Commit

Permalink
Exposed minCharacterizationMean param to createAggregateCovariateSett…
Browse files Browse the repository at this point in the history
…ings.

Updated examples to demonstrate createAggregateCovariateSettings$minCharacterizationMean param.
Updated package version to 0.2.0.
Updated News.md with changes.
Regenerated site with pkgdown.
  • Loading branch information
chrisknoll committed Apr 19, 2024
1 parent 3fb59ec commit 8e2ac6c
Show file tree
Hide file tree
Showing 44 changed files with 130 additions and 100 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Characterization
Type: Package
Title: Characterizations of Cohorts
Version: 0.1.5
Version: 0.2.0
Date: 2024-04-03
Authors@R: c(
person("Jenna", "Reps", , "[email protected]", role = c("aut", "cre")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Characterization 0.2.0
======================
Updated dependency to FeatureExtraction (>= 3.5.0) to support minCharacterizationMean paramater.


Characterization 0.1.5
======================
Changed export to csv approach to use batch export from SQLite (#41)
Expand Down
12 changes: 9 additions & 3 deletions R/AggregateCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#' @param minPriorObservation The minimum time in the database a patient in the target cohorts must be observed prior to index
#' @template timeAtRisk
#' @param covariateSettings An object created using \code{FeatureExtraction::createCovariateSettings}
#' @param minCharacterizationMean The minimum mean value for characterization output. Values below this will be cut off from output. This
#' will help reduce the file size of the characterization output, but will remove information
#' on covariates that have very low values. The default is 0.
#'
#' @return
#' A list with the settings
Expand All @@ -34,7 +37,8 @@ createAggregateCovariateSettings <- function(
startAnchor = "cohort start",
riskWindowEnd = 365,
endAnchor = "cohort start",
covariateSettings) {
covariateSettings,
minCharacterizationMean = 0) {
errorMessages <- checkmate::makeAssertCollection()
# check targetIds is a vector of int/double
.checkCohortIds(
Expand Down Expand Up @@ -81,7 +85,8 @@ createAggregateCovariateSettings <- function(
startAnchor = startAnchor,
riskWindowEnd = riskWindowEnd,
endAnchor = endAnchor,
covariateSettings = covariateSettings
covariateSettings = covariateSettings,
minCharacterizationMean = minCharacterizationMean
)

class(result) <- "aggregateCovariateSettings"
Expand Down Expand Up @@ -163,7 +168,8 @@ computeAggregateCovariateAnalyses <- function(
cohortId = -1,
covariateSettings = aggregateCovariateSettings$covariateSettings,
cdmVersion = cdmVersion,
aggregated = T
aggregated = T,
minCharacterizationMean = aggregateCovariateSettings$minCharacterizationMean
)
# adding counts as a new table
result$cohortCounts <- counts
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ targetIds <- c(1,2,4)
useDemographicsAge = T,
useDemographicsRace = T
)
)
)

aggregateCovariateSettings2 <- createAggregateCovariateSettings(
targetIds = targetIds,
Expand Down
4 changes: 2 additions & 2 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/InstallationGuide.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions docs/articles/UsingCharacterizationPackage.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e2ac6c

Please sign in to comment.