Commit ac19bad6 authored by Alec L. Robitaille's avatar Alec L. Robitaille 🚲

Merge branch 'bug/xmidS-supplied-2-items' into 'master'

Bug/xmid s supplied 2 items

See merge request !2
parents 8296eacf f1878983
Pipeline #125371971 passed with stages
in 8 minutes and 59 seconds
......@@ -48,9 +48,9 @@ model_start <- function(DT, id = 'id', year = 'yr') {
by = c(id, year)]
data.table::setkey(DT, 'scaled')
DT[difS > 0, xmidS_start := .SD[list(0.5), t, roll = 'nearest'],
DT[difS > 0, xmidS_start := .SD[list(0.5), t, roll = 'nearest'][[1]],
by = c(id, year), .SDcols = c('scaled', 't')]
DT[difS < 0, xmidA_start := .SD[list(0.5), t, roll = 'nearest'],
DT[difS < 0, xmidA_start := .SD[list(0.5), t, roll = 'nearest'][[1]],
by = c(id, year), .SDcols = c('scaled', 't')]
DT[, xmidS_start := .SD[!is.na(xmidS_start), xmidS_start[1]],
......
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