metrumresearchgroup / pmplots

Plots for Pharmacometrics
https://metrumresearchgroup.github.io/pmplots
8 stars 1 forks source link

Consistent handling of integer / numeric when deciding what plot to make #103

Open kylebaron opened 3 weeks ago

kylebaron commented 3 weeks ago

Summary

eta_covariate() will error when integer x-data is passed in. eta_covariate() will test for integer data and call cont_cat(), but cont_cat() is set up to only accept character, factor, or logical on the x-axis.

Consistent handling of integer / numeric

# This works
> eta_covariate(id, x = co, y = params$eta_names)

# This doesnt
> id2 <- id %>% dplyr::mutate(AGE = as.integer(AGE))
> eta_covariate(id2, x = co, y = params$eta_names)
Error: column AGE is required to be character, factor, or logical