diff --git a/R/L_dens1D.R b/R/L_dens1D.R index d7ff17c..e6ffe32 100644 --- a/R/L_dens1D.R +++ b/R/L_dens1D.R @@ -32,7 +32,7 @@ l_dens1D.Check0DVectorNumeric <- function(a){ "id" = factor(c(rep("obs", n), rep("sim", n*nsim)))) if( is.null(a$mapping) ) { - a$mapping <- aes("x" = x, "y" = stat(density), "colour" = id, "fill" = id) + a$mapping <- aes("x" = x, "y" = after_stat(density), "colour" = id, "fill" = id) } a$inherit.aes <- FALSE @@ -59,7 +59,7 @@ l_dens1D.Check0DScalarNumeric <- function(a){ a$data <- data.frame("x" = as.vector(unlist(a$data$sim))) if( is.null(a$mapping) ) { - a$mapping <- aes("x" = x, "y" = stat(density)) + a$mapping <- aes("x" = x, "y" = after_stat(density)) } if( is.null(a$fill) ){ a$fill = "#56B4E9" } diff --git a/R/L_hist.R b/R/L_hist.R index 1a60b50..aa90d64 100644 --- a/R/L_hist.R +++ b/R/L_hist.R @@ -33,7 +33,7 @@ l_hist.Check0DVectorNumeric <- function(a){ "id" = factor(c(rep("obs", n), rep("sim", n*nsim)))) if( is.null(a$mapping) ) { - a$mapping <- aes("x" = x, "y" = stat(density), "colour" = id, "fill" = id) + a$mapping <- aes("x" = x, "y" = after_stat(density), "colour" = id, "fill" = id) } a$inherit.aes <- FALSE @@ -60,7 +60,7 @@ l_hist.Check0DScalarNumeric <- function(a){ a$data <- data.frame("x" = as.vector(unlist(a$data$sim))) if( is.null(a$mapping) ) { - a$mapping <- aes("x" = x, "y" = stat(density)) + a$mapping <- aes("x" = x, "y" = after_stat(density)) } if( is.null(a$fill) ){ a$fill = "#56B4E9" } diff --git a/R/check2D.R b/R/check2D.R index 99b1daa..ba41faa 100644 --- a/R/check2D.R +++ b/R/check2D.R @@ -134,7 +134,7 @@ check2D <- function(o, x1, x2, type = "auto", maxpo = 1e4, na.rm = TRUE, trans = x2 <- as.vector( x2 ) if( length(x1) != nrow(y) || length(x2) != nrow(y) ){ - stop("x1 and x2 should be a vector of same lenght as residuals(o)") + stop("x1 and x2 should be a vector of same length as residuals(o)") } # Discard NAs