You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(omopgenerics)
#> #> Attaching package: 'omopgenerics'#> The following object is masked from 'package:stats':#> #> filter
library(CDMConnector)
#> #> Attaching package: 'CDMConnector'#> The following objects are masked from 'package:omopgenerics':#> #> cdmName, recordCohortAttrition, uniqueTableName
library(dplyr)
#> Warning: package 'dplyr' was built under R version 4.2.3#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, union
library(CohortConstructor)
#> #> Attaching package: 'CohortConstructor'#> The following objects are masked from 'package:CDMConnector':#> #> intersectCohorts, unionCohortscon<-DBI::dbConnect(duckdb::duckdb(), dbdir= eunomia_dir())
cdm<- cdm_from_con(con, cdm_schema="main",
write_schema= c(prefix="my_study_", schema="main"))
fracture_codes<- newCodelist(list("ankle_fracture"=4059173L,
"forearm_fracture"=4278672L,
"hip_fracture"=4230399L))
cdm$fractures<-cdm|>
conceptCohort(conceptSet=fracture_codes,
name="fractures")
#> ℹ Subsetting table condition_occurrence using 3 concepts with domain:#> condition.#> ℹ Combining tables.#> ℹ Creating cohort attributes.#> ℹ Applying cohort requirements.#> ℹ Collapsing records.#> ✔ Cohort fractures created.cdm$fractures_2<-cdm$fractures|>
subsetCohorts(cohortId="forearm_fracture",
name="fractures_2")
cdm$fractures_2<-cdm$fractures|>
subsetCohorts(cohortId=dplyr::starts_with("forearm"),
name="fractures_2")
#> Error:#> ! `starts_with()` must be used within a *selecting* function.#> ℹ See <https://tidyselect.r-lib.org/reference/faq-selection-context.html> for#> details.#> Backtrace:#> ▆#> 1. ├─CohortConstructor::subsetCohorts(...)#> 2. │ └─CohortConstructor:::validateCohortId(cohortId, settings(cohort)) at CohortConstructor/R/subsetCohorts.R:29:3#> 3. └─dplyr::starts_with("forearm") at CohortConstructor/R/subsetCohorts.R:29:3#> 4. ├─vars %||% peek_vars(fn = "starts_with")#> 5. └─tidyselect::peek_vars(fn = "starts_with")#> 6. └─cli::cli_abort(...)#> 7. └─rlang::abort(...)
Created on 2024-09-21 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: