Skip to content

Support different x-axis variables for VPC plots #32

@mccarthy-m-g

Description

@mccarthy-m-g

Right now it's only possible to use TIME, but it would be nice to be able to use other variables like TAD. For example, the following does not work because sim only contains "ID", "TIME", "DV", and "ITER" as columns:

plot(res, obs_cols = list(idv = "TAD"), sim_cols = list(idv = "TAD"))

We might be able to accomplish this simply by left joining sim and data:

plot_vpc <- function(res, ...) {
  rlang::check_installed("vpc", reason = "for VPC plotting.")
  rlang::check_dots_used()
  vpc::vpc(
    sim = dplyr::left_join(res$sim, dplyr::filter(res$data, .data$EVID == 0)),
    obs = dplyr::filter(res$data, .data$EVID == 0),
    ...
  )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions