rpact-com / rpact

rpact: Confirmatory Adaptive Clinical Trial Design and Analysis
https://rpact-com.github.io/rpact/
23 stars 5 forks source link

Example from help(plot.Dataset) seems incorrect #15

Closed TimHesterberg closed 8 months ago

TimHesterberg commented 9 months ago
library(rpact)
library(help = rpact)
# Version:                       3.5.0.9228
?plot.Dataset

# The first example is:
dataExample <- getDataset(
    n1 = c(22, 11, 22, 11),
    n2 = c(22, 13, 22, 13),
    means1 = c(1, 1.1, 1, 1),
    means2 = c(1.4, 1.5, 3, 2.5),
    stDevs1 = c(1, 2, 2, 1.3),
    stDevs2 = c(1, 2, 2, 1.3)
)
if (require(ggplot2)) plot(dataExample, main = "Comparison of Means")

# That gives warning messages:
# Warning messages:
# 1: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> = "none")` instead. 
# 2: Removed 73 rows containing non-finite values (stat_boxplot). 
# 3: Removed 73 rows containing non-finite values (stat_summary). 
# 4: Removed 73 rows containing missing values (geom_point). 

# The plot is missing the treatment group at stages 2 and 4

# The second example, plotting rates, also gives the first warning message.
fpahlke commented 9 months ago

Many thanks, Tim, for figuring this out. I will find a solution and let you know when it is available on GitHub. Best, Friedrich

fpahlke commented 8 months ago

Fixed in branch dev/3.5.1