Skip to content

Commit

Permalink
Avoid warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Fasiolo committed Apr 16, 2024
1 parent ad85487 commit 0403a4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/L_dens1D.R
Expand Up @@ -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
Expand All @@ -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" }

Expand Down
4 changes: 2 additions & 2 deletions R/L_hist.R
Expand Up @@ -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
Expand All @@ -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" }

Expand Down
2 changes: 1 addition & 1 deletion R/check2D.R
Expand Up @@ -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
Expand Down

0 comments on commit 0403a4f

Please sign in to comment.