Commit 2727d1fe authored by Anna Tominaga's avatar Anna Tominaga
Browse files

Merge branch 'substudy_cogs' into 'master'

Fixed error described in issue #3 by making query be collected prior to calculation of DSR

See merge request aspree/aspree-r-package!41
parents dc6532ab 328c0106
......@@ -221,9 +221,10 @@ GetSubstudyCogs <- function(con, filterVisitTimes = NA, excludeOnSNORE = TRUE) {
) %>% rename(
CT2NumErrs = CT2NoErrs,
C_CT2NumErrs = C_CT2NoErrs
) %>% collect(
) %>% mutate(
CogTests_TSR = as.numeric(visitDate - as.Date(RandDt))
) %>% select(-c("visitDate", "RandDt"))
CogTests_DSR = ceiling(difftime(as.POSIXct(visitDate, tz="Australia/Melbourne", offset=1), as.Date(RandDt, tz="Australia/Melbourne", offset = 1), units ="days"))
) %>% select(-c("visitDate", "RandDt"))
if (excludeOnSNORE) {
cogs <- cogs %>% filter(OnSNORE == 0 | is.na(OnSNORE))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment