Skip to content

skip patients with no records with EVID == 0 #40

@jasmineirx

Description

@jasmineirx

This package is intended to evaluate model predictions. When coding this package we made the reasonable assumption that all patients would have at least one record with EVID == 0. However, if this is not the case, the package fails with a confusing error message.

The issue is that we create covariates based on records with EVID == 0:

obs_data <- dplyr::filter(data, .data$EVID == 0)

If no such record exists, we call PKPDsim::new_covariate anyways, which does not expect to received times as a numeric vector of length 0. The resulting error message is something like this

Error in `purrr::map()`:
ℹ In index: 2909.
Caused by error in `purrr::map()`:
ℹ In index: 1.
ℹ With name: WT.
Caused by error in `tmp[i, ]$incl`:
! $ operator is invalid for atomic vectors

In my opinion, skipping and warning encounters where there are no markers is reasonable. We could also check the data set and stop if this condition is not met for all encounters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions