R/functions-new.R
changed.
R/internal.functions-new-code-2.R
changed.
Other files ignored by Codecov
tests/testthat/test-benford.R
has changed.
332 | 332 | } |
|
333 | 333 | } |
|
334 | 334 | ||
335 | + | nGraphics <- length(plots) |
|
335 | 336 | ||
336 | - | if (multiple) { |
|
337 | + | if (multiple | (nGraphics == 1)) { |
|
337 | 338 | old.par <- par(no.readonly = TRUE) |
|
338 | 339 | on.exit(par(old.par)) |
|
339 | 340 | ||
340 | - | nGraphics <- length(plots) |
|
341 | - | ||
342 | 341 | if (nGraphics < 4) { |
|
343 | 342 | rows = 1; |
|
344 | 343 | cols = nGraphics |
358 | 357 | plot_this[1:nGraphics] <- plots |
|
359 | 358 | m <- matrix(c(1:nslots, rep(nslots + 1, cols)), nrow = rows + 1, ncol = cols,byrow = TRUE) |
|
360 | 359 | layout(mat = m, heights = c(rep(0.9/rows, rows), 0.1)) |
|
360 | + | lg_size <- ifelse(rows > 1, 1, ifelse(err.bounds, 0.6, 0.7)) |
|
361 | + | }else{ |
|
362 | + | old.par <- par(no.readonly = TRUE) |
|
363 | + | on.exit(par(old.par)) |
|
364 | + | plot_this <- vector("character", nGraphics*2) |
|
365 | + | plot_this[seq(1, nGraphics*2, 2)] <- plots |
|
366 | + | plot_this[seq(2, nGraphics*2, 2)] <- "legend" |
|
367 | + | m <- matrix(c(1,2), nrow = 2, ncol = 1,byrow = TRUE) |
|
368 | + | layout(mat = m, heights = c(0.9, 0.1)) |
|
369 | + | lg_size <- ifelse(err.bounds, 0.6, 0.7) |
|
361 | 370 | } |
|
362 | 371 | ||
363 | - | lg_size <- ifelse(rows > 1, 1, ifelse(err.bounds, 0.6, 0.7)) |
|
364 | - | ||
365 | 372 | for (i in 1:length(plot_this)) { |
|
366 | 373 | switch(plot_this[i], |
|
367 | 374 | "digits" = plotting.data.vs.benford(x, col.bar, grid, err.bounds, alpha, ...), |
549 | 549 | ||
550 | 550 | plotting.legend <- function(x, err.bounds, size) { |
|
551 | 551 | par(mar = c(0,0,0,0)) |
|
552 | - | #plot(1, type = "n", axes = FALSE, xlab = "", ylab = "", main = paste("Legend \n Dataset:", x[["info"]]$data.name)) |
|
553 | 552 | plot(1, type = "n", axes = FALSE, xlab = "", ylab = "", main = "") |
|
554 | 553 | if (err.bounds) { |
|
555 | 554 | plot_colors <- c("lightblue","red","red") |
575 | 574 | lty = rep(1, 2), |
|
576 | 575 | horiz = TRUE) |
|
577 | 576 | } |
|
577 | + | par(mar = c(5, 4, 4, 2) + 0.1) |
|
578 | 578 | } |
Files | Coverage |
---|---|
R | 100.00% |
Project Totals (3 files) | 100.00% |