Skip to content

Donut VPC works for complete dataset, not for subset #1

@chenxuli-umn

Description

@chenxuli-umn

Hello,

Nice work for this package.

Recently, I'm trying to use this for my own project. However, I encountered some issues when plotting the donut VPC.

It works for my complete dataset:
``
df2 <- df %>% filter(TIME == 0) %>% select(WT, Alb, CRP)

cop <- vine(df2)

sim <- rcopula(cop, sim_nr = 100)

donut <- donutVPC( sim_data = sim, obs_data = df2, percentiles = c(5, 50, 95),
sim_nr = 100, conf_band = 99,
colors_bands = c("#99E0DC", "#E498B4"),
cores = 4)

``

But it doesn’t work for the subset (PER refers to periods of a individual, study is cross over designed with 2 periods per individual) :
``
df3 <- df %>% filter(TIME == 0, PER ==1) %>% select(WT, Alb, CRP)

cop <- vine(df3)

sim <- rcopula(cop, sim_nr = 100)

donut <- donutVPC( sim_data = sim, obs_data = df3, percentiles = c(5, 50, 95),
sim_nr = 100, conf_band = 99,
colors_bands = c("#99E0DC", "#E498B4"),
cores = 4)

``

It gives me an error message shown below:
``
Error in dplyr::mutate():
ℹ In argument: `percentile =
names(contour_levels[contour_levels == level[1]])`.
Caused by error:
! `percentile` must be size 139 or 1, not 2.
Run `rlang::last_trace()` to see where the error occurred.

``

Appreciate any insights on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions