OHDSI / Capr

Cohort definition Application Programming in R
https://ohdsi.github.io/Capr
Apache License 2.0
17 stars 11 forks source link

What's the right way to get json from Capr code object? #72

Closed carmenOT closed 1 year ago

carmenOT commented 1 year ago
library(DatabaseConnector)
library(Capr)
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
connection <- connect(connectionDetails)
#> Connecting using SQLite driver
gibleed <- cs(descendants(192671))
gibleedCohort <- cohort(entry = entry(condition(gibleed)))
as.json(gibleedCohort)
#> Error: 'list_flatten' is not an exported object from 'namespace:purrr'
disconnect(con)
#> Error in disconnect(con): object 'con' not found

Created on 2023-07-01 with reprex v2.0.2

mdlavallee92 commented 1 year ago

What version of Capr and purrr are you using? You need to have purrr version 1.0.1 or greater

carmenOT commented 1 year ago

Installing Purrr from GitHub helped, as CRAN wouldn't let me upgrade the package. It all works now, thanks!

mdlavallee92 commented 1 year ago

Closing..Similar to #65. Install purrr version 1.0.1 to get list_flatten function. Thanks @carmenOT