Through a Stack Overflow question, I discovered this package. Looks great! The question wasn't specifically related to this package, but the answer is. (Unless I'm completely daft...which, ya, that's definitely possible.)
The questioner was essentially asking why their user-defined function wasn't working. This function included powerscale_plot_quantities. The issue only occurs when you set mcse = TRUE.
Currently, the plot calls all use aes_strings, which is deprecated. However, this only generates a warning. I'm not sure why strings are called, either. (All of these could be changed to aes after removing the quotes.) The issue lies in the last bit of code in powerscale_summary_plot (called by powerscale_plot_quantities).
p <- p + ggplot2::scale_linetype_manual(values = "dashed", name = NULL) +
ggplot2::geom_hline(ggplot2::aes_string(yintercept = "mcse_min",
linetype = "+/-2MCSE"),
data = base_mcse, color = "black") +
ggplot2::geom_hline(ggplot2::aes_string(yintercept = "mcse_max",
linetype = "+/-2MCSE"),
data = base_mcse, color = "black")
The use of linetype here sets the name shown in the legend. However, when aes_strings is used, this name is interpreted as symbolic. Since there is no variable with this name in the data, it renders an error. The following code fixes the issue created here.
p <- p + ggplot2::geom_hline(ggplot2::aes(yintercept = mcse_min,
linetype = "+/-2MCSE"),
data = base_mcse, color = "black") +
ggplot2::geom_hline(ggplot2::aes(yintercept = mcse_max,
linetype = "+/-2MCSE"),
data = base_mcse, color = "black")
Through a Stack Overflow question, I discovered this package. Looks great! The question wasn't specifically related to this package, but the answer is. (Unless I'm completely daft...which, ya, that's definitely possible.)
The questioner was essentially asking why their user-defined function wasn't working. This function included
powerscale_plot_quantities
. The issue only occurs when you setmcse = TRUE
.Currently, the plot calls all use
aes_strings
, which is deprecated. However, this only generates a warning. I'm not sure why strings are called, either. (All of these could be changed toaes
after removing the quotes.) The issue lies in the last bit of code inpowerscale_summary_plot
(called bypowerscale_plot_quantities
).The use of
linetype
here sets the name shown in the legend. However, whenaes_strings
is used, this name is interpreted as symbolic. Since there is no variable with this name in the data, it renders an error. The following code fixes the issue created here.