closes #20
Showing 1 of 12 files from the diff.
R/vdist-chisquare.R
changed.
Other files ignored by Codecov
man/vdist_chisquare_plot.Rd
has changed.
docs/reference/vdist_chisquare_plot-5.png
has changed.
docs/reference/vdist_chisquare_plot-4.png
has changed.
docs/reference/vdist_chisquare_plot-7.png
has changed.
docs/reference/vdist_chisquare_plot-6.png
has changed.
docs/reference/vdist_chisquare_plot-1.png
has changed.
tests/testthat/test-visual.R
has changed.
docs/reference/vdist_chisquare_plot-3.png
has changed.
docs/reference/vdist_chisquare_plot-2.png
has changed.
docs/reference/vdist_chisquare_plot.html
has changed.
@@ -10,6 +10,7 @@
Loading
10 | 10 | #' @param type Lower tail or upper tail. |
|
11 | 11 | #' @param normal If \code{TRUE}, normal curve with same \code{mean} and |
|
12 | 12 | #' \code{sd} as the chi square distribution is drawn. |
|
13 | + | #' @param xaxis_range The upper range of the X axis. |
|
13 | 14 | #' @param print_plot logical; if \code{TRUE}, prints the plot else returns a plot object. |
|
14 | 15 | #' |
|
15 | 16 | #' @examples |
@@ -30,7 +31,8 @@
Loading
30 | 31 | #' |
|
31 | 32 | #' @export |
|
32 | 33 | #' |
|
33 | - | vdist_chisquare_plot <- function(df = 3, normal = FALSE, print_plot = TRUE) { |
|
34 | + | vdist_chisquare_plot <- function(df = 3, normal = FALSE, |
|
35 | + | xaxis_range = 25, print_plot = TRUE) { |
|
34 | 36 | ||
35 | 37 | if (!is.numeric(df)) { |
|
36 | 38 | stop("df must be numeric/integer") |
@@ -43,7 +45,7 @@
Loading
43 | 45 | df <- as.integer(df) |
|
44 | 46 | chim <- round(df, 3) |
|
45 | 47 | chisd <- round(sqrt(2 * df), 3) |
|
46 | - | x <- seq(0, 25, 0.01) |
|
48 | + | x <- seq(0, xaxis_range, 0.01) |
|
47 | 49 | data <- stats::dchisq(x, df) |
|
48 | 50 | ||
49 | 51 | plot_data <- data.frame(x = x, chi = data) |
@@ -62,7 +64,7 @@
Loading
62 | 64 | ggplot2::xlab(paste("Mean =", chim, " Std Dev. =", chisd)) + |
|
63 | 65 | ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5), |
|
64 | 66 | plot.subtitle = ggplot2::element_text(hjust = 0.5)) + |
|
65 | - | ggplot2::scale_x_continuous(breaks = seq(0, 25, 2)) + |
|
67 | + | ggplot2::scale_x_continuous(breaks = seq(0, xaxis_range, 2)) + |
|
66 | 68 | ggplot2::geom_polygon(data = poly_data, |
|
67 | 69 | mapping = ggplot2::aes(x = y, y = z), |
|
68 | 70 | fill = '#4682B4') + |
Files | Coverage |
---|---|
R | 91.41% |
Project Totals (8 files) | 91.41% |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.