Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`ceoi` errors when an interval has more than one dose row

Aperta
#695 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
r
Ambito
data

Direzione di ricerca

Start with pk.calc.ceoi() and trace how it receives dose rows and interval concentration times; the reprex uses pk.nca() with PKNCAdata(). Add tests for contiguous infusion segments, unchanged single infusion behavior, and an unsampled infusion end. Done when multiple dose rows no longer cause an error and the result is the concentration at the last infusion end, or NA with an exclude reason when that time was not observed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

pk.calc.ceoi() assumes a scalar duration.dose (if (is.na(duration.dose))). With two infusion rows in one interval the whole pk.nca() call stops with an internal error.

Reprex

Uses o_conc and o_dose from Issue 1.

pk.nca(PKNCAdata(o_conc, o_dose,
  intervals = data.frame(start = 0, end = Inf, ceoi = TRUE)))
Error ... Please report a bug.
Error with interval start=0, end=Inf: the condition has length > 1
Caused by error in `if (is.na(duration.dose)) ...`:
! the condition has length > 1
Expected

A scalar ceoi: the concentration at the end of the last infusion segment in the interval, max(time.dose + duration.dose) among doses with duration > 0. In the example that is the concentration at 3 h. Return NA with an exclude reason when that time was not observed, matching the current single-dose behaviour.

If the definition is ambiguous (for example, separate infusions with a gap between them), an exclude reason or a documented rule is better than an error.

pk.calc.ceoi() currently compares time with duration.dose directly. It also needs time.dose, so that an infusion starting after the interval start is located correctly.

Tests to add
  • Two contiguous segments return the concentration at the end of the second.
  • A single infusion gives the same result as before.
  • When the end of the infusion was not sampled, the result is NA with an exclude reason, not an error.
Lingua principale
R
Stelle
86
Fork
32
Merge medio
16h 25m
PR unite (30g)
51

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di humanpred/pknca

Tutte le issue di humanpred/pknca

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.