Skip to content

Commit

Permalink
Merge pull request #257 from OHDSI/develop
Browse files Browse the repository at this point in the history
Release v3.5.2
  • Loading branch information
ginberg authored May 2, 2024
2 parents a93992b + f2a850c commit f4536fb
Show file tree
Hide file tree
Showing 119 changed files with 533 additions and 445 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ deploy.sh
compare_versions
_pkgdown.yml
nbactions.xml
^CRAN-SUBMISSION$
^cran-comments\.md$
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 3.5.2
Date: 2024-04-30 18:12:58 UTC
SHA: fe1f8048024d84e8079e872e60c4623c9d0c5c5f
21 changes: 11 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Package: FeatureExtraction
Type: Package
Title: Generating Features for a Cohort
Version: 3.5.1
Date: 2024-04-22
Version: 3.5.2
Date: 2024-05-01
Authors@R: c(
person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut")),
person("Marc", "Suchard", role = c("aut")),
person("Patrick", "Ryan", role = c("aut")),
person("Jenna", "Reps", role = c("aut")),
person("Anthony", "Sena", , "sena@ohdsi.org", role = c("aut", "cre")),
person("Ger", "Inberg", role = c("aut"))
person("Anthony", "Sena", , "sena@ohdsi.org", role = c("aut")),
person("Ger", "Inberg", , "g.inberg@erasmusmc.nl", role = c("aut", "cre")),
person("Observational Health Data Science and Informatics", role = c("cph"))
)
Maintainer: Anthony Sena <sena@ohdsi.org>
Description: An R package for generating features (covariates) for a cohort using data in the Common Data Model.
Maintainer: Ger Inberg <g.inberg@erasmusmc.nl>
Description: An R interface for generating features for a cohort using data in the Common Data Model. Features can be constructed using default or custom made feature definitions. Furthermore it's possible to aggregate features and get the summary statistics.
Depends:
R (>= 3.2.2),
DatabaseConnector (>= 3.0.0),
Expand All @@ -35,10 +36,10 @@ Suggests:
testthat,
knitr,
rmarkdown,
Eunomia,
withr
Remotes:
ohdsi/Eunomia
Eunomia (>= 2.0.0),
withr,
curl,
httr
License: Apache License 2.0
VignetteBuilder: knitr
URL: https://github.com/OHDSI/FeatureExtraction
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(createDefaultCovariateSettings)
export(createDefaultTemporalCovariateSettings)
export(createDetailedCovariateSettings)
export(createDetailedTemporalCovariateSettings)
export(createEmptyCovariateData)
export(createTable1)
export(createTable1CovariateSettings)
export(createTemporalCovariateSettings)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
FeatureExtraction 3.5.2
=======================

- Move FeatureExtraction to CRAN (#104)

FeatureExtraction 3.5.1
=======================

Expand Down
4 changes: 2 additions & 2 deletions R/Aggregation.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#' An object of class \code{covariateData}.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
Expand Down
2 changes: 1 addition & 1 deletion R/CompareCohorts.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' of mean.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' binaryCovDataFile <- system.file("testdata/binaryCovariateData.zip",
#' package = "FeatureExtraction"
#' )
Expand Down
26 changes: 15 additions & 11 deletions R/CovariateData.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ setClass("CovariateData", contains = "Andromeda")
#' @details
#' The data will be written to a set of files in the folder specified by the user.
#'
#' @return No return value, called for side effects.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
Expand Down Expand Up @@ -96,7 +98,7 @@ saveCovariateData <- function(covariateData, file) {
#' An object of class \code{CovariateData}.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' binaryCovDataFile <- system.file("testdata/binaryCovariateData.zip",
#' package = "FeatureExtraction"
#' )
Expand Down Expand Up @@ -183,7 +185,7 @@ print.summary.CovariateData <- function(x, ...) {
#' A logical value.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' binaryCovDataFile <- system.file("testdata/binaryCovariateData.zip",
#' package = "FeatureExtraction"
#' )
Expand All @@ -204,8 +206,8 @@ isCovariateData <- function(x) {
#' A logical value.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
Expand All @@ -232,8 +234,8 @@ isAggregatedCovariateData <- function(x) {
#' A logical value.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
Expand All @@ -259,17 +261,19 @@ isTemporalCovariateData <- function(x) {
#' @param temporal if the data is temporary
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
#' )
#' }
#' @return the empty CovariateData object
#' @return an empty object of class \code{CovariateData}
#'
#' @export
createEmptyCovariateData <- function(cohortIds, aggregated, temporal) {
dummy <- tibble(
cohortDefinitionId = 1,
covariateId = 1,
covariateValue = 1
)
Expand Down
10 changes: 5 additions & 5 deletions R/DetailedCovariateSettings.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' An object of type \code{covariateSettings}, to be used in other functions.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' analysisDetails <- createAnalysisDetails(
#' analysisId = 1,
#' sqlFileName = "DemographicsGender.sql",
Expand Down Expand Up @@ -78,7 +78,7 @@ createDetailedCovariateSettings <- function(analyses = list()) {
#' An object of type \code{covariateSettings}, to be used in other functions.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' analysisDetails <- createAnalysisDetails(
#' analysisId = 1,
#' sqlFileName = "DemographicsGender.sql",
Expand Down Expand Up @@ -193,7 +193,7 @@ createAnalysisDetails <- function(analysisId,
#' An object of type \code{covariateSettings}, to be used in other functions.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' covSettings <- createDefaultCovariateSettings()
#' detailedSettings <- convertPrespecSettingsToDetailedSettings(covariateSettings = covSettings)
#' }
Expand Down Expand Up @@ -225,7 +225,7 @@ convertPrespecSettingsToDetailedSettings <- function(covariateSettings) {
#' An object of type \code{covariateSettings}, to be used in other functions.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' covSettings <- createDefaultCovariateSettings(
#' includedCovariateConceptIds = c(1),
#' addDescendantsToInclude = FALSE,
Expand Down Expand Up @@ -273,7 +273,7 @@ createDefaultCovariateSettings <- function(includedCovariateConceptIds = c(),
#' An object of type \code{covariateSettings}, to be used in other functions.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' covSettings <- createDefaultTemporalCovariateSettings(
#' includedCovariateConceptIds = c(1),
#' addDescendantsToInclude = FALSE,
Expand Down
2 changes: 1 addition & 1 deletion R/GetCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#' Returns an object of type \code{covariateData}, containing information on the covariates.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' eunomiaConnectionDetails <- Eunomia::getEunomiaConnectionDetails()
#' covSettings <- createDefaultCovariateSettings()
#' Eunomia::createCohorts(
Expand Down
16 changes: 2 additions & 14 deletions R/GetCovariatesFromCohortAttributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' @template GetCovarParams
#'
#' @examples
#' \dontrun{
#' \donttest{
#' connectionDetails <- Eunomia::getEunomiaConnectionDetails()
#' Eunomia::createCohorts(
#' connectionDetails = connectionDetails,
Expand All @@ -34,18 +34,6 @@
#' cohortTable = "cohort"
#' )
#' connection <- DatabaseConnector::connect(connectionDetails)
#' sql <- "SELECT 1 AS attribute_definition_id, 'Length of observation in days' AS attribute_name
#' INTO @cohort_database_schema.@attribute_definition_table;"
#' sql <- SqlRender::render(
#' sql,
#' cohort_database_schema = "main",
#' attribute_definition_table = "attribute_definition"
#' )
#' sql <- SqlRender::translate(
#' sql = sql,
#' targetDialect = attr(connection, "dbms")
#' )
#' DatabaseConnector::executeSql(connection, sql)
#' covariateSettings <- createCohortAttrCovariateSettings(
#' attrDatabaseSchema = "main",
#' cohortAttrTable = "cohort_attribute",
Expand Down Expand Up @@ -196,7 +184,7 @@ getDbCohortAttrCovariatesData <- function(connection,
#' An object of type \code{covariateSettings}, to be used in other functions.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' covariateSettings <- createCohortAttrCovariateSettings(
#' analysisId = 1,
#' attrDatabaseSchema = "main",
Expand Down
15 changes: 9 additions & 6 deletions R/GetDefaultCovariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,25 @@
#' @template GetCovarParams
#'
#' @examples
#' \dontrun{
#' \donttest{
#' connectionDetails <- Eunomia::getEunomiaConnectionDetails()
#' Eunomia::createCohorts(
#' connectionDetails = connectionDetails,
#' cdmDatabaseSchema = "main",
#' cohortDatabaseSchema = "main",
#' cohortTable = "cohort"
#' )
#' connection <- DatabaseConnector::connect(connectionDetails)
#' Eunomia::createCohorts(connectionDetails)
#'
#' results <- getDbDefaultCovariateData(
#' connection = connection,
#' cdmDatabaseSchema = "main",
#' cohortTable = "cohort",
#' covariateSettings = createDefaultCovariateSettings(),
#' targetDatabaseSchema = "main",
#' targetCovariateTable = "ut_cov",
#' targetCovariateRefTable = "ut_cov_ref",
#' targetAnalysisRefTable = "ut_cov_analysis_ref"
#' targetCovariateTable = "ut_cov"
#' )
#' }
#'
#' @export
getDbDefaultCovariateData <- function(connection,
oracleTempSchema = NULL,
Expand Down
12 changes: 6 additions & 6 deletions R/HelperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#' An object of type \code{covariateData}.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
Expand Down Expand Up @@ -72,10 +72,10 @@ filterByRowId <- function(covariateData, rowIds) {
#' An object of type \code{covariateData}.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = c(1, 2),
#' aggregated = TRUE,
#' temporal = FALSE
#' )
#'
Expand Down
6 changes: 4 additions & 2 deletions R/Normalization.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
#' @param normalize Normalize the covariates? (dividing by the max).
#' @param removeRedundancy Should redundant covariates be removed?
#'
#' @return An object of class \code{CovariateData}.
#'
#' @examples
#' \dontrun{
#' covariateData <- FeatureExtraction:::createEmptyCovariateData(
#' \donttest{
#' covariateData <- FeatureExtraction::createEmptyCovariateData(
#' cohortIds = 1,
#' aggregated = FALSE,
#' temporal = FALSE
Expand Down
6 changes: 3 additions & 3 deletions R/Table1.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' A specifications objects.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' defaultTable1Specs <- getDefaultTable1Specifications()
#' }
#'
Expand Down Expand Up @@ -64,7 +64,7 @@ getDefaultTable1Specifications <- function() {
#' A data frame, or, when \code{output = "list"} a list of two data frames.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' eunomiaConnectionDetails <- Eunomia::getEunomiaConnectionDetails()
#' covSettings <- createDefaultCovariateSettings()
#' Eunomia::createCohorts(
Expand Down Expand Up @@ -680,7 +680,7 @@ createTable1 <- function(covariateData1,
#' \code{\link{getDbCovariateData}} function.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' table1CovSettings <- createTable1CovariateSettings(
#' specifications = getDefaultTable1Specifications(),
#' covariateSettings = createDefaultCovariateSettings(),
Expand Down
28 changes: 0 additions & 28 deletions R/UnitTestHelperFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
#' @return
#' Returns an object of type \code{covariateSettings}, containing settings for the covariates.
#'
#' @examples
#' \dontrun{
#' looCovariateSettings <- .createLooCovariateSettings(useLengthOfObs = TRUE)
#' }
#'
.createLooCovariateSettings <- function(useLengthOfObs = TRUE) {
covariateSettings <- list(useLengthOfObs = useLengthOfObs)
attr(covariateSettings, "fun") <- "FeatureExtraction:::.getDbLooCovariateData"
Expand Down Expand Up @@ -65,29 +60,6 @@
#' @return
#' Returns an object of type \code{covariateData}, containing information on the covariates.
#'
#' @examples
#' \dontrun{
#' eunomiaConnectionDetails <- Eunomia::getEunomiaConnectionDetails()
#' covSettings <- .createLooCovariateSettings(useLengthOfObs = TRUE)
#' Eunomia::createCohorts(
#' connectionDetails = eunomiaConnectionDetails,
#' cdmDatabaseSchema = "main",
#' cohortDatabaseSchema = "main",
#' cohortTable = "cohort"
#' )
#' connection <- DatabaseConnector::connect(connectionDetails)
#' looCovariateData <- .getDbLooCovariateData(connection,
#' oracleTempSchema = NULL,
#' cdmDatabaseSchema = "main",
#' cohortTable = "cohort",
#' cohortId = 1,
#' cdmVersion = "5",
#' rowIdField = "subject_id",
#' covariateSettings = covSettings,
#' aggregated = FALSE
#' )
#' }
#'
.getDbLooCovariateData <- function(connection,
oracleTempSchema = NULL,
cdmDatabaseSchema,
Expand Down
Loading

0 comments on commit f4536fb

Please sign in to comment.