diff --git a/.Rbuildignore b/.Rbuildignore index 45a6db7ed..78b9c2c07 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -31,3 +31,5 @@ ggduo_paper.txt ^\.github$ ^doc$ ^Meta$ +^CRAN-RELEASE$ +^vignettes$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 460e11643..242dda789 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -5,6 +5,7 @@ on: pull_request: branches: - master + - rc-* name: R-CMD-check diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index f7f036f1b..de3620e74 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -6,6 +6,7 @@ on: pull_request: branches: - master + - rc-* name: pkgdown @@ -52,7 +53,7 @@ jobs: CAN_PRINT: "TRUE" run: | pkgdown::build_site() - stopifnot(length(warnings) == 0) + stopifnot(length(warnings()) == 0) shell: Rscript {0} - name: Build and Deploy Site diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index fd5515c8d..03e9c34b4 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -5,6 +5,7 @@ on: pull_request: branches: - master + - rc-* name: test-coverage diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 000000000..4d759fbe8 --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2020-06-05. +Once it is accepted, delete this file and tag the release (commit 11d821418b). diff --git a/DESCRIPTION b/DESCRIPTION index 2e42a36e0..1732b63be 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: GGally -Version: 1.5.0.9000 +Version: 2.0.0 License: GPL (>= 2.0) Title: Extension to 'ggplot2' Type: Package @@ -64,7 +64,7 @@ Suggests: spelling Roxygen: list(markdown = FALSE) RoxygenNote: 7.1.0 -VignetteBuilder: knitr SystemRequirements: openssl Encoding: UTF-8 Language: en-US +RdMacros: lifecycle diff --git a/NAMESPACE b/NAMESPACE index 75977a035..8ca07864c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -116,6 +116,7 @@ export(stat_prop) export(stat_weighted_mean) export(uppertriangle) export(v1_ggmatrix_theme) +export(vig_ggally) export(weighted_mean_sd) export(weighted_median_iqr) export(wrap) diff --git a/NEWS.md b/NEWS.md index e6cdbeb41..b2ede00d4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,23 +1,22 @@ -GGally (development version) ---------------------- +# GGally 2.0.0 ### New Vignettes -* `vignette("ggally_plots", package = "GGally")` - List of available high-level plots -* `vignette("ggally_stats", package = "GGally")` - Additional statistics for ggplot2 -* `vignette("ggbivariate", package = "GGally")` - ggbivariate(): Plot an outcome with several potential explanatory variables -* `vignette("ggtable", package = "GGally")` - ggtable(): Cross-tabulated tables -* Call `browseVignettes(package = "GGally")` to view all vignettes for `GGally` +* `vig_ggally("ggally_plots")` - ggally_*(): List of available high-level plots +* `vig_ggally("ggally_stats")` - stat_*(): Additional statistics for ggplot2 +* `vig_ggally("ggbivariate")` - ggbivariate(): Plot an outcome with several potential explanatory variables +* `vig_ggally("ggtable")` - ggtable(): Cross-tabulated tables +* To view all vignettes for `GGally`, call `GGally::vig_ggally()` ### New functions `ggbivariate()` (@larmarange, #324) * Display an outcome using several potential explanatory variables -* `vignette("ggbivariate")` +* `vig_ggally("ggbivariate")` `ggtable()` (@larmarange, #351) * Cross-tabulated tables of discrete variables -* `vignette("ggtable")` +* `vig_ggally("ggtable")` `add_to_ggmatrix()` (#362) * Add ggplot2 objects to `ggmatrix` objects at selected locations diff --git a/R/deprecated.R b/R/deprecated.R index 15b8c88a9..d38e95042 100644 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -1,13 +1,15 @@ #' Modify a \code{\link{ggmatrix}} object by adding an \pkg{ggplot2} object to all #' -# \Sexpr[results=rd, stage=render]{lifecycle::badge("deprecated")} +# \lifecycle{deprecated} #' #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' -#' ggpairs(iris, 1:2) + v1_ggmatrix_theme() +#' p_(ggpairs(iris, 1:2) + v1_ggmatrix_theme()) #' # move the column names to the left and bottom -#' ggpairs(iris, 1:2, switch = "both") + v1_ggmatrix_theme() +#' p_(ggpairs(iris, 1:2, switch = "both") + v1_ggmatrix_theme()) v1_ggmatrix_theme <- function() { theme( strip.background = element_rect(fill = "white"), @@ -18,7 +20,7 @@ v1_ggmatrix_theme <- function() { #' Correlation value plot #' -# \Sexpr[results=rd, stage=render]{lifecycle::badge("deprecated")} +# \lifecycle{deprecated} #' #' (Deprecated. See \code{\link{ggally_cor}}.) #' @@ -40,27 +42,33 @@ v1_ggmatrix_theme <- function() { #' @export #' @keywords hplot #' @examples -#' data(tips, package = "reshape") -#' ggally_cor_v1_5(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) -#' # display with no grid -#' ggally_cor_v1_5( -#' tips, -#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), -#' displayGrid = FALSE -#' ) -#' # change text attributes -#' ggally_cor_v1_5( -#' tips, -#' mapping = ggplot2::aes(x = total_bill, y = tip), -#' size = 15, -#' colour = I("red") -#' ) -#' # split by a variable -#' ggally_cor_v1_5( -#' tips, -#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), -#' size = 5 -#' ) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_cor_v1_5(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +#' +#' # display with no grid +#' p_(ggally_cor_v1_5( +#' tips, +#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), +#' displayGrid = FALSE +#' )) +#' +#' # change text attributes +#' p_(ggally_cor_v1_5( +#' tips, +#' mapping = ggplot2::aes(x = total_bill, y = tip), +#' size = 15, +#' colour = I("red") +#' )) +#' +#' # split by a variable +#' p_(ggally_cor_v1_5( +#' tips, +#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), +#' size = 5 +#' )) ggally_cor_v1_5 <- function( data, mapping, diff --git a/R/gg-plots.R b/R/gg-plots.R index 2e6018ce9..aad4b1dc3 100644 --- a/R/gg-plots.R +++ b/R/gg-plots.R @@ -116,10 +116,13 @@ remove_color_unless_equal <- function(mapping, to = c("x", "y")) { #' @export #' @keywords hplot #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(mtcars) -#' ggally_points(mtcars, mapping = ggplot2::aes(x = disp, y = hp)) -#' ggally_points(mtcars, mapping = ggplot2::aes_string(x = "disp", y = "hp")) -#' ggally_points( +#' p_(ggally_points(mtcars, mapping = ggplot2::aes(x = disp, y = hp))) +#' p_(ggally_points(mtcars, mapping = ggplot2::aes_string(x = "disp", y = "hp"))) +#' p_(ggally_points( #' mtcars, #' mapping = ggplot2::aes_string( #' x = "disp", @@ -127,7 +130,7 @@ remove_color_unless_equal <- function(mapping, to = c("x", "y")) { #' color = "as.factor(cyl)", #' size = "gear" #' ) -#' ) +#' )) ggally_points <- function(data, mapping, ...){ p <- ggplot(data = data, mapping = mapping) + geom_point(...) @@ -151,10 +154,13 @@ ggally_points <- function(data, mapping, ...){ #' @keywords hplot #' @rdname ggally_smooth #' @examples -#' data(tips, package = "reshape") -#' ggally_smooth(tips, mapping = ggplot2::aes(x = total_bill, y = tip)) -#' ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) -#' ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex")) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_smooth(tips, mapping = ggplot2::aes(x = total_bill, y = tip))) +#' p_(ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +#' p_(ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"))) ggally_smooth <- function(data, mapping, ..., method = "lm", formula = y ~ x, se = TRUE, shrink = TRUE) { p <- ggplot(data = data, mapping) @@ -201,17 +207,20 @@ ggally_smooth_lm <- function(data, mapping, ...) { #' @export #' @keywords hplot #' @examples -#' data(tips, package = "reshape") -#' ggally_density(tips, mapping = ggplot2::aes(x = total_bill, y = tip)) -#' ggally_density(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) -#' ggally_density( -#' tips, -#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") -#' ) -#' ggally_density( -#' tips, -#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") -#' ) + ggplot2::scale_fill_gradient(breaks = c(0.05, 0.1, 0.15, 0.2)) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_density(tips, mapping = ggplot2::aes(x = total_bill, y = tip))) +#' p_(ggally_density(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +#' p_(ggally_density( +#' tips, +#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") +#' )) +#' p_(ggally_density( +#' tips, +#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") +#' ) + ggplot2::scale_fill_gradient(breaks = c(0.05, 0.1, 0.15, 0.2))) ggally_density <- function(data, mapping, ...){ rangeX <- range(eval_data_col(data, mapping$x), na.rm = TRUE) rangeY <- range(eval_data_col(data, mapping$y), na.rm = TRUE) @@ -263,28 +272,31 @@ ggally_density <- function(data, mapping, ...){ #' @export #' @keywords hplot #' @examples -#' data(tips, package = "reshape") -#' ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) -#' # display with grid -#' ggally_cor( -#' tips, -#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), -#' display_grid = TRUE -#' ) -#' # change text attributes -#' ggally_cor( -#' tips, -#' mapping = ggplot2::aes(x = total_bill, y = tip), -#' size = 15, -#' colour = I("red"), -#' title = "Correlation" -#' ) -#' # split by a variable -#' ggally_cor( -#' tips, -#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), -#' size = 5 -#' ) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +#' # display with grid +#' p_(ggally_cor( +#' tips, +#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), +#' display_grid = TRUE +#' )) +#' # change text attributes +#' p_(ggally_cor( +#' tips, +#' mapping = ggplot2::aes(x = total_bill, y = tip), +#' size = 15, +#' colour = I("red"), +#' title = "Correlation" +#' )) +#' # split by a variable +#' p_(ggally_cor( +#' tips, +#' mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), +#' size = 5 +#' )) ggally_cor <- function( data, mapping, @@ -592,16 +604,19 @@ ggally_statistic <- function( #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_box(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) -#' ggally_box(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex")) -#' ggally_box( -#' tips, -#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex"), -#' outlier.colour = "red", -#' outlier.shape = 13, -#' outlier.size = 8 -#' ) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_box(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +#' p_(ggally_box(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))) +#' p_(ggally_box( +#' tips, +#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex"), +#' outlier.colour = "red", +#' outlier.shape = 13, +#' outlier.size = 8 +#' )) ggally_box <- function(data, mapping, ...){ mapping <- mapping_color_to_fill(mapping) @@ -627,17 +642,20 @@ ggally_box_no_facet <- function(data, mapping, ...) { #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_dot(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) -#' ggally_dot(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex")) -#' ggally_dot( -#' tips, -#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") -#' ) -#' ggally_dot( -#' tips, -#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex", shape = "sex") -#' ) + ggplot2::scale_shape(solid=FALSE) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_dot(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +#' p_(ggally_dot(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))) +#' p_(ggally_dot( +#' tips, +#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") +#' )) +#' p_(ggally_dot( +#' tips, +#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex", shape = "sex") +#' ) + ggplot2::scale_shape(solid=FALSE)) ggally_dot <- function(data, mapping, ...){ ggally_dot_and_box(data, mapping, ..., boxPlot = FALSE) } @@ -660,17 +678,20 @@ ggally_dot_no_facet <- function(data, mapping, ...) { #' @keywords internal #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_dot_and_box( -#' tips, -#' mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), -#' boxPlot = TRUE -#' ) -#' ggally_dot_and_box( -#' tips, -#' mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), -#' boxPlot = FALSE -#' ) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_dot_and_box( +#' tips, +#' mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), +#' boxPlot = TRUE +#' )) +#' p_(ggally_dot_and_box( +#' tips, +#' mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), +#' boxPlot = FALSE +#' )) ggally_dot_and_box <- function(data, mapping, ..., boxPlot = TRUE){ horizontal <- is_horizontal(data, mapping) @@ -744,9 +765,12 @@ ggally_dot_and_box_no_facet <- function(data, mapping, ..., boxPlot = TRUE) { #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_facethist(tips, mapping = ggplot2::aes(x = tip, y = sex)) -#' ggally_facethist(tips, mapping = ggplot2::aes_string(x = "tip", y = "sex"), binwidth = 0.1) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_facethist(tips, mapping = ggplot2::aes(x = tip, y = sex))) +#' p_(ggally_facethist(tips, mapping = ggplot2::aes_string(x = "tip", y = "sex"), binwidth = 0.1)) ggally_facethist <- function(data, mapping, ...){ mapping <- mapping_color_to_fill(mapping) @@ -791,12 +815,15 @@ ggally_facethist <- function(data, mapping, ...){ #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) -#' ggally_facetdensity( -#' tips, -#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") -#' ) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +#' p_(ggally_facetdensity( +#' tips, +#' mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") +#' )) ggally_facetdensity <- function(data, mapping, ...){ ggally_facetdensitystrip(data, mapping, ..., den_strip = FALSE) } @@ -812,13 +839,16 @@ ggally_facetdensity <- function(data, mapping, ...){ #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_denstrip(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) -#' ggally_denstrip(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex")) -#' ggally_denstrip( -#' tips, -#' mapping = ggplot2::aes_string(x = "sex", y = "tip", binwidth = "0.2") -#' ) + ggplot2::scale_fill_gradient(low = "grey80", high = "black") +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_denstrip(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +#' p_(ggally_denstrip(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))) +#' p_(ggally_denstrip( +#' tips, +#' mapping = ggplot2::aes_string(x = "sex", y = "tip", binwidth = "0.2") +#' ) + ggplot2::scale_fill_gradient(low = "grey80", high = "black")) ggally_denstrip <- function(data, mapping, ...){ mapping <- mapping_color_to_fill(mapping) @@ -910,9 +940,12 @@ ggally_facetdensitystrip <- function(data, mapping, ..., den_strip = FALSE){ #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill)) -#' ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill, color = day)) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill))) +#' p_(ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill, color = day))) ggally_densityDiag <- function(data, mapping, ..., rescale = FALSE){ mapping <- mapping_color_to_fill(mapping) @@ -949,9 +982,12 @@ ggally_densityDiag <- function(data, mapping, ..., rescale = FALSE){ #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_barDiag(tips, mapping = ggplot2::aes(x = day)) -#' ggally_barDiag(tips, mapping = ggplot2::aes(x = tip), binwidth = 0.25) +#' p_(ggally_barDiag(tips, mapping = ggplot2::aes(x = day))) +#' p_(ggally_barDiag(tips, mapping = ggplot2::aes(x = tip), binwidth = 0.25)) ggally_barDiag <- function(data, mapping, ..., rescale = FALSE){ mapping <- mapping_color_to_fill(mapping) @@ -1006,8 +1042,11 @@ ggally_barDiag <- function(data, mapping, ..., rescale = FALSE){ #' @keywords hplot #' @export #' @examples -#' ggally_text("Example 1") -#' ggally_text("Example\nTwo", mapping = ggplot2::aes(size = 15), color = I("red")) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' p_(ggally_text("Example 1")) +#' p_(ggally_text("Example\nTwo", mapping = ggplot2::aes(size = 15), color = I("red"))) ggally_text <- function( label, mapping = ggplot2::aes(color = "black"), @@ -1154,9 +1193,12 @@ get_x_axis_labels <- function(p, xRange) { #' @author Jason Crowley and Barret Schloerke #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_diagAxis(tips, ggplot2::aes(x=tip)) -#' ggally_diagAxis(tips, ggplot2::aes(x=sex)) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_diagAxis(tips, ggplot2::aes(x=tip))) +#' p_(ggally_diagAxis(tips, ggplot2::aes(x=sex))) ggally_diagAxis <- function( data, mapping, @@ -1275,9 +1317,12 @@ ggally_diagAxis <- function( #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_facetbar(tips, ggplot2::aes(x = sex, y = smoker, fill = time)) -#' ggally_facetbar(tips, ggplot2::aes(x = smoker, y = sex, fill = time)) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' p_(ggally_facetbar(tips, ggplot2::aes(x = sex, y = smoker, fill = time))) +#' p_(ggally_facetbar(tips, ggplot2::aes(x = smoker, y = sex, fill = time))) ggally_facetbar <- function(data, mapping, ...){ mapping <- mapping_color_to_fill(mapping) @@ -1307,14 +1352,17 @@ ggally_facetbar <- function(data, mapping, ...){ #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_ratio(tips, ggplot2::aes(sex, day)) -#' ggally_ratio(tips, ggplot2::aes(sex, day)) + ggplot2::coord_equal() +#' p_(ggally_ratio(tips, ggplot2::aes(sex, day))) +#' p_(ggally_ratio(tips, ggplot2::aes(sex, day)) + ggplot2::coord_equal()) #' # only plot tiles greater or equal to 20 and scale to a max of 50 -#' ggally_ratio( +#' p_(ggally_ratio( #' tips, ggplot2::aes(sex, day), #' floor = 20, ceiling = 50 -#' ) + ggplot2::theme(aspect.ratio = 4/2) +#' ) + ggplot2::theme(aspect.ratio = 4/2)) ggally_ratio <- function( data, mapping = do.call(ggplot2::aes_string, as.list(colnames(data)[1:2])), @@ -1406,19 +1454,22 @@ ggally_ratio <- function( #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex)) -#' ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex, fill = day)) +#' p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex))) +#' p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex, fill = day))) #' -#' ggally_count( +#' p_(ggally_count( #' as.data.frame(Titanic), #' mapping = ggplot2::aes(x = Class, y = Survived, weight = Freq) -#' ) -#' ggally_count( +#' )) +#' p_(ggally_count( #' as.data.frame(Titanic), #' mapping = ggplot2::aes(x = Class, y = Survived, weight = Freq), #' x.width = 0.5 -#' ) +#' )) ggally_count <- function(data, mapping, ...) { mapping <- mapping_color_to_fill(mapping) if (is.null(mapping$x)) stop("'x' aesthetic is required.") @@ -1534,9 +1585,11 @@ StatGGallyCount <- ggproto("StatGGallyCount", Stat, #' @rdname ggally_count #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' -#' ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker)) -#' ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker, fill = sex)) +#' p_(ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker))) +#' p_(ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker, fill = sex))) ggally_countDiag <- function(data, mapping, ...) { mapping$y <- mapping$x ggally_count(data = data, mapping = mapping, ...) @@ -1655,22 +1708,23 @@ ggally_naDiag <- function(...) { #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_autopoint(tips, mapping = aes(x = tip, y = total_bill)) -#' ggally_autopoint(tips, mapping = aes(x = tip, y = sex)) -#' ggally_autopoint(tips, mapping = aes(x = smoker, y = sex)) -#' ggally_autopoint(tips, mapping = aes(x = smoker, y = sex, color = day)) -#' ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), size = 8) -#' ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), alpha = .9) -#' -#' \dontrun{ -#' ggpairs( +#' p_(ggally_autopoint(tips, mapping = aes(x = tip, y = total_bill))) +#' p_(ggally_autopoint(tips, mapping = aes(x = tip, y = sex))) +#' p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex))) +#' p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex, color = day))) +#' p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), size = 8)) +#' p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), alpha = .9)) +#' +#' p_(ggpairs( #' tips, #' mapping = aes(colour = sex), #' upper = list(discrete = "autopoint", combo = "autopoint", continuous = "autopoint"), #' diag = list(discrete = "autopointDiag", continuous = "autopointDiag") -#' ) -#' } +#' )) ggally_autopoint <- function(data, mapping, ...) { require_namespaces("ggforce") @@ -1705,27 +1759,32 @@ ggally_autopointDiag <- function(data, mapping, ...) { #' @keywords hplot #' @export #' @examples -#' data(tips, package = "reshape") -#' ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day)) -#' ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill)) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' -#' # colour is kept only if equal to the discrete variable -#' ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = day)) -#' ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = sex)) -#' ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill, color = day)) +#' if (require(Hmisc)) { +#' data(tips, package = "reshape") +#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day))) +#' p_(ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill))) #' -#' # custom text size -#' ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), size = 6) +#' # colour is kept only if equal to the discrete variable +#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = day))) +#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = sex))) +#' p_(ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill, color = day))) #' -#' # change statistic to display -#' ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_mean_sd) +#' # custom text size +#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), size = 6)) #' -#' # custom stat function -#' weighted_sum <- function(x, weights = NULL) { -#' if (is.null(weights)) weights <- 1 -#' paste0("Total : ", round(sum(x * weights, na.rm = TRUE), digits = 1)) +#' # change statistic to display +#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_mean_sd)) +#' +#' # custom stat function +#' weighted_sum <- function(x, weights = NULL) { +#' if (is.null(weights)) weights <- 1 +#' paste0("Total : ", round(sum(x * weights, na.rm = TRUE), digits = 1)) +#' } +#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_sum)) #' } -#' ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_sum) ggally_summarise_by <- function( data, mapping, @@ -1812,4 +1871,3 @@ weighted_mean_sd <- function(x, weights = NULL) { sd <- round(sqrt(Hmisc::wtd.var(x, weights = weights, na.rm = TRUE)), digits = 1) paste0("Mean: ", m, " (", sd, ")") } - diff --git a/R/ggbivariate.R b/R/ggbivariate.R index 4b5e9176a..5e40c0a9d 100644 --- a/R/ggbivariate.R +++ b/R/ggbivariate.R @@ -17,23 +17,25 @@ #' @author Joseph Larmarange #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")) +#' p_(ggbivariate(tips, "smoker", c("day", "time", "sex", "tip"))) #' -#' \dontrun{ #' # Personalize plot title and legend title -#' ggbivariate( +#' p_(ggbivariate( #' tips, "smoker", c("day", "time", "sex", "tip"), #' title = "Custom title" #' ) + -#' labs(fill = "Smoker ?") +#' labs(fill = "Smoker ?")) #' #' # Customize fill colour scale -#' ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")) + -#' scale_fill_brewer(type = "qual") +#' p_(ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")) + +#' scale_fill_brewer(type = "qual")) #' #' # Customize labels -#' ggbivariate( +#' p_(ggbivariate( #' tips, "smoker", c("day", "time", "sex", "tip"), #' rowbar_args = list( #' colour = "white", @@ -41,19 +43,18 @@ #' fontface = "bold", #' label_format = scales::label_percent(accurary = 1) #' ) -#' ) +#' )) #' #' # Choose the sub-plot from which get legend -#' ggbivariate(tips, "smoker") -#' ggbivariate(tips, "smoker", legend = 3) +#' p_(ggbivariate(tips, "smoker")) +#' p_(ggbivariate(tips, "smoker", legend = 3)) #' #' # Use mapping to indicate weights #' d <- as.data.frame(Titanic) -#' ggbivariate(d, "Survived", mapping = aes(weight = Freq)) +#' p_(ggbivariate(d, "Survived", mapping = aes(weight = Freq))) #' #' # outcome can be numerical -#' ggbivariate(tips, outcome = "tip", title = "tip") -#' } +#' p_(ggbivariate(tips, outcome = "tip", title = "tip")) ggbivariate <- function( data, outcome, diff --git a/R/ggcoef.R b/R/ggcoef.R index e6910ffd8..d60535517 100644 --- a/R/ggcoef.R +++ b/R/ggcoef.R @@ -23,9 +23,12 @@ #' @param sort \code{"none"} (default) do not sort, \code{"ascending"} sort by increasing coefficient value, or \code{"descending"} sort by decreasing coefficient value #' @param ... additional arguments sent to \code{\link[ggplot2]{geom_point}} #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' library(broom) #' reg <- lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data = iris) -#' ggcoef(reg) +#' p_(ggcoef(reg)) #' \donttest{d <- as.data.frame(Titanic) #' reg2 <- glm(Survived ~ Sex + Age + Class, family = binomial, data = d, weights = d$Freq) #' ggcoef(reg2, exponentiate = TRUE) diff --git a/R/ggcorr.R b/R/ggcorr.R index 7cf1b811f..c2503e9d7 100644 --- a/R/ggcorr.R +++ b/R/ggcorr.R @@ -99,19 +99,22 @@ if (getRversion() >= "2.15.1") { #' @importFrom stats cor #' @importFrom grDevices colorRampPalette #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' # Basketball statistics provided by Nathan Yau at Flowing Data. #' dt <- read.csv("http://datasets.flowingdata.com/ppg2008.csv") #' #' # Default output. -#' ggcorr(dt[, -1]) +#' p_(ggcorr(dt[, -1])) #' -#' # Labelled output, with coefficient transparency. -#' ggcorr(dt[, -1], +#' # Labeled output, with coefficient transparency. +#' p_(ggcorr(dt[, -1], #' label = TRUE, -#' label_alpha = TRUE) +#' label_alpha = TRUE)) #' #' # Custom options. -#' ggcorr( +#' p_(ggcorr( #' dt[, -1], #' name = expression(rho), #' geom = "circle", @@ -122,13 +125,13 @@ if (getRversion() >= "2.15.1") { #' nbreaks = 6, #' angle = -45, #' palette = "PuOr" # colorblind safe, photocopy-able -#' ) +#' )) #' #' # Supply your own correlation matrix -#' ggcorr( +#' p_(ggcorr( #' data = NULL, #' cor_matrix = cor(dt[, -1], use = "pairwise") -#' ) +#' )) ggcorr <- function( data, method = c("pairwise", "pearson"), diff --git a/R/gglyph.R b/R/gglyph.R index 9f967353d..a348625e7 100644 --- a/R/gglyph.R +++ b/R/gglyph.R @@ -19,21 +19,24 @@ #' @export #' @author Di Cook, Heike Hofmann, Hadley Wickham #' @examples -#' data(nasa) -#' nasaLate <- nasa[ -#' nasa$date >= as.POSIXct("1998-01-01") & -#' nasa$lat >= 20 & -#' nasa$lat <= 40 & -#' nasa$long >= -80 & -#' nasa$long <= -60 -#' , ] -#' temp.gly <- glyphs(nasaLate, "long", "day", "lat", "surftemp", height=2.5) -#' ggplot2::ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) + -#' add_ref_lines(temp.gly, color = "grey90") + -#' add_ref_boxes(temp.gly, color = "grey90") + -#' ggplot2::geom_path() + -#' ggplot2::theme_bw() + -#' ggplot2::labs(x = "", y = "") +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(nasa) +#' nasaLate <- nasa[ +#' nasa$date >= as.POSIXct("1998-01-01") & +#' nasa$lat >= 20 & +#' nasa$lat <= 40 & +#' nasa$long >= -80 & +#' nasa$long <= -60 +#' , ] +#' temp.gly <- glyphs(nasaLate, "long", "day", "lat", "surftemp", height=2.5) +#' p_(ggplot2::ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) + +#' add_ref_lines(temp.gly, color = "grey90") + +#' add_ref_boxes(temp.gly, color = "grey90") + +#' ggplot2::geom_path() + +#' ggplot2::theme_bw() + +#' ggplot2::labs(x = "", y = "")) glyphs <- function( data, x_major, x_minor, diff --git a/R/ggmatrix.R b/R/ggmatrix.R index 3f868acd3..f836b72e9 100644 --- a/R/ggmatrix.R +++ b/R/ggmatrix.R @@ -25,7 +25,7 @@ #' @importFrom rlang %||% #' @export #' @examples -#' # small function to display plots only if it's interactive +#' # Small function to display plots only if it's interactive #' p_ <- GGally::print_if_interactive #' #' plotList <- list() @@ -50,7 +50,6 @@ #' showXAxisPlotLabels = FALSE #' ) #' p_(pm) - ggmatrix <- function( plots, nrow, diff --git a/R/ggmatrix_legend.R b/R/ggmatrix_legend.R index 42336654d..824820053 100644 --- a/R/ggmatrix_legend.R +++ b/R/ggmatrix_legend.R @@ -7,6 +7,9 @@ #' @import ggplot2 #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' library(ggplot2) #' histPlot <- qplot( #' x = Sepal.Length, @@ -20,10 +23,10 @@ #' (top <- histPlot + theme(legend.position = "top")) #' (left <- histPlot + theme(legend.position = "left")) #' -#' grab_legend(right) -#' grab_legend(bottom) -#' grab_legend(top) -#' grab_legend(left) +#' p_(grab_legend(right)) +#' p_(grab_legend(bottom)) +#' p_(grab_legend(top)) +#' p_(grab_legend(left)) grab_legend <- function(p) { builtP <- ggplot_build(p) pTable <- ggplot_gtable(builtP) @@ -63,12 +66,15 @@ print.legend_guide_box <- function(x, ..., plotNew = FALSE) { #' @return a function that when called with arguments will produce the legend of the plotting function supplied. #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' # display regular plot -#' ggally_points(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) +#' p_(ggally_points(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species))) #' #' # Make a function that will only print the legend #' points_legend <- gglegend(ggally_points) -#' points_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) +#' p_(points_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species))) #' #' # produce the sample legend plot, but supply a string that 'wrap' understands #' same_points_legend <- gglegend("points") @@ -79,7 +85,7 @@ print.legend_guide_box <- function(x, ..., plotNew = FALSE) { #' #' # Complicated examples #' custom_legend <- wrap(gglegend("points"), size = 6) -#' custom_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) +#' p_(custom_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species))) #' #' # Use within ggpairs #' pm <- ggpairs( @@ -87,13 +93,13 @@ print.legend_guide_box <- function(x, ..., plotNew = FALSE) { #' mapping = ggplot2::aes(color = Species), #' upper = list(continuous = gglegend("points")) #' ) -#' # pm +#' p_(pm) #' #' # Place a legend in a specific location #' pm <- ggpairs(iris, 1:2, mapping = ggplot2::aes(color = Species)) #' # Make the legend #' pm[1,2] <- points_legend(iris, ggplot2::aes(Sepal.Width, Sepal.Length, color = Species)) -#' pm +#' p_(pm) gglegend <- function(fn) { # allows users to supply a character just like in ggpairs diff --git a/R/ggnet.R b/R/ggnet.R index 5d75fffcb..d5fad81b5 100644 --- a/R/ggnet.R +++ b/R/ggnet.R @@ -136,6 +136,9 @@ if (getRversion() >= "2.15.1") { #' @importFrom utils head installed.packages #' @importFrom grDevices gray.colors #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' library(network) #' #' # random adjacency matrix @@ -160,10 +163,10 @@ if (getRversion() >= "2.15.1") { #' # color palette #' p <- c("a" = "steelblue", "b" = "forestgreen", "c" = "tomato") #' -#' ggnet(n, node.group = g, node.color = p, label = TRUE, color = "white") +#' p_(ggnet(n, node.group = g, node.color = p, label = TRUE, color = "white")) #' #' # edge arrows on a directed network -#' ggnet(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10) +#' p_(ggnet(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10)) ggnet <- function( net, mode = "fruchtermanreingold", diff --git a/R/ggnet2.R b/R/ggnet2.R index 9358f987f..4cd05e382 100644 --- a/R/ggnet2.R +++ b/R/ggnet2.R @@ -199,6 +199,9 @@ if (getRversion() >= "2.15.1") { #' @importFrom utils installed.packages #' @importFrom grDevices gray.colors #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' library(network) #' #' # random adjacency matrix @@ -214,42 +217,42 @@ if (getRversion() >= "2.15.1") { #' n <- network::network(m, directed = FALSE) #' n #' -#' ggnet2(n, label = TRUE) -#' ggnet2(n, label = TRUE, shape = 15) -#' ggnet2(n, label = TRUE, shape = 15, color = "black", label.color = "white") +#' p_(ggnet2(n, label = TRUE)) +#' p_(ggnet2(n, label = TRUE, shape = 15)) +#' p_(ggnet2(n, label = TRUE, shape = 15, color = "black", label.color = "white")) #' #' # add vertex attribute #' x = network.vertex.names(n) #' x = ifelse(x %in% c("a", "e", "i"), "vowel", "consonant") #' n %v% "phono" = x #' -#' ggnet2(n, color = "phono") -#' ggnet2(n, color = "phono", palette = c("vowel" = "gold", "consonant" = "grey")) -#' ggnet2(n, shape = "phono", color = "phono") +#' p_(ggnet2(n, color = "phono")) +#' p_(ggnet2(n, color = "phono", palette = c("vowel" = "gold", "consonant" = "grey"))) +#' p_(ggnet2(n, shape = "phono", color = "phono")) #' #' if (require(RColorBrewer)) { #' #' # random groups #' n %v% "group" <- sample(LETTERS[1:3], 10, replace = TRUE) #' -#' ggnet2(n, color = "group", palette = "Set2") +#' p_(ggnet2(n, color = "group", palette = "Set2")) #' #' } #' #' # random weights #' n %e% "weight" <- sample(1:3, network.edgecount(n), replace = TRUE) -#' ggnet2(n, edge.size = "weight", edge.label = "weight") +#' p_(ggnet2(n, edge.size = "weight", edge.label = "weight")) #' #' # edge arrows on a directed network -#' ggnet2(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10) +#' p_(ggnet2(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10)) #' #' # Padgett's Florentine wedding data #' data(flo, package = "network") #' flo #' -#' ggnet2(flo, label = TRUE) -#' ggnet2(flo, label = TRUE, label.trim = 4, vjust = -1, size = 3, color = 1) -#' ggnet2(flo, label = TRUE, size = 12, color = "white") +#' p_(ggnet2(flo, label = TRUE)) +#' p_(ggnet2(flo, label = TRUE, label.trim = 4, vjust = -1, size = 3, color = 1)) +#' p_(ggnet2(flo, label = TRUE, size = 12, color = "white")) ggnet2 <- function( net, mode = "fruchtermanreingold", diff --git a/R/ggnostic.R b/R/ggnostic.R index 0adb2c4b7..effbebe4d 100644 --- a/R/ggnostic.R +++ b/R/ggnostic.R @@ -207,8 +207,11 @@ ggally_nostic_line <- function( #' @export #' @importFrom stats qnorm #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -#' ggally_nostic_resid(dt, ggplot2::aes(wt, .resid)) +#' p_(ggally_nostic_resid(dt, ggplot2::aes(wt, .resid))) ggally_nostic_resid <- function( data, mapping, ..., linePosition = 0, @@ -271,8 +274,11 @@ ggally_nostic_resid <- function( #' @rdname ggally_nostic_std_resid #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -#' ggally_nostic_std_resid(dt, ggplot2::aes(wt, .std.resid)) +#' p_(ggally_nostic_std_resid(dt, ggplot2::aes(wt, .std.resid))) ggally_nostic_std_resid <- function( data, mapping, ..., sigma = 1 @@ -303,8 +309,11 @@ ggally_nostic_std_resid <- function( #' @return \pkg{ggplot2} plot object #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -#' ggally_nostic_se_fit(dt, ggplot2::aes(wt, .se.fit)) +#' p_(ggally_nostic_se_fit(dt, ggplot2::aes(wt, .se.fit))) ggally_nostic_se_fit <- function( data, mapping, ..., lineColor = brew_colors("grey"), @@ -335,8 +344,11 @@ ggally_nostic_se_fit <- function( #' @return \pkg{ggplot2} plot object #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -#' ggally_nostic_sigma(dt, ggplot2::aes(wt, .sigma)) +#' p_(ggally_nostic_sigma(dt, ggplot2::aes(wt, .sigma))) ggally_nostic_sigma <- function( data, mapping, ..., lineColor = brew_colors("grey"), @@ -367,8 +379,11 @@ ggally_nostic_sigma <- function( #' @export #' @importFrom stats pf #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -#' ggally_nostic_cooksd(dt, ggplot2::aes(wt, .cooksd)) +#' p_(ggally_nostic_cooksd(dt, ggplot2::aes(wt, .cooksd))) ggally_nostic_cooksd <- function( data, mapping, ..., linePosition = pf(0.5, length(attr(data, "var_x")), nrow(data) - length(attr(data, "var_x"))), @@ -408,8 +423,11 @@ ggally_nostic_cooksd <- function( #' @return \pkg{ggplot2} plot object #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -#' ggally_nostic_hat(dt, ggplot2::aes(wt, .hat)) +#' p_(ggally_nostic_hat(dt, ggplot2::aes(wt, .hat))) ggally_nostic_hat <- function( data, mapping, ..., linePosition = 2 * sum(eval_data_col(data, mapping$y)) / nrow(data), @@ -720,7 +738,10 @@ ggnostic <- function( #' @return \code{\link{ggmatrix}} object #' @export #' @examples -#' ggts(pigs, "time", c("gilts", "profit", "s_per_herdsz", "production", "herdsz")) +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' p_(ggts(pigs, "time", c("gilts", "profit", "s_per_herdsz", "production", "herdsz"))) ggts <- function( ..., columnLabelsX = NULL, diff --git a/R/ggpairs.R b/R/ggpairs.R index b92a3e60d..9c29fe90c 100644 --- a/R/ggpairs.R +++ b/R/ggpairs.R @@ -293,7 +293,7 @@ stop_if_high_cardinality <- function(data, columns, threshold) { #' continuous = wrap("smooth_loess", alpha = 0.50, shape = "+") #' ), #' showStrips = FALSE -#' ); +#' ) #' #' p_(pm) #' @@ -655,8 +655,8 @@ ggduo <- function( #' @author Barret Schloerke, Jason Crowley, Di Cook, Heike Hofmann, Hadley Wickham #' @return \code{\link{ggmatrix}} object that if called, will print #' @examples -#' # small function to display plots only if it's interactive -#' p_ <- GGally::print_if_interactive +#' # small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' #' #' ## Quick example, with and without colour diff --git a/R/ggpairs_add.R b/R/ggpairs_add.R index cfdd9b3f3..3b27c252b 100644 --- a/R/ggpairs_add.R +++ b/R/ggpairs_add.R @@ -29,17 +29,20 @@ #' @method + gg #' @rdname gg-add #' @examples +#' # small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' data(tips, package = "reshape") +#' #' pm <- ggpairs(tips[, 2:4], ggplot2::aes(color = sex)) #' ## change to black and white theme #' pm + ggplot2::theme_bw() #' ## change to linedraw theme -#' # pm + ggplot2::theme_linedraw() +#' p_(pm + ggplot2::theme_linedraw()) #' ## change to custom theme -#' # pm + ggplot2::theme(panel.background = ggplot2::element_rect(fill = "lightblue")) +#' p_(pm + ggplot2::theme(panel.background = ggplot2::element_rect(fill = "lightblue"))) #' ## add a list of information #' extra <- list(ggplot2::theme_bw(), ggplot2::labs(caption = "My caption!")) -#' pm + extra +#' p_(pm + extra) "+.gg" <- function(e1, e2) { if (!is.ggmatrix(e1)) { @@ -127,17 +130,17 @@ add_theme_to_ggmatrix <- function(e1, e2) { #' @seealso \code{\link{ggmatrix_location}} #' @examples #' ## modify scale -#' pm + scale_fill_brewer(type = "qual") +#' p_(pm + scale_fill_brewer(type = "qual")) #' ## only first row -#' add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), rows = 1:2) +#' p_(add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), rows = 1:2)) #' ## only second col -#' add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), cols = 2:3) +#' p_(add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), cols = 2:3)) #' ## only to upper triangle of plot matrix -#' add_to_ggmatrix( +#' p_(add_to_ggmatrix( #' pm, #' scale_fill_brewer(type = "qual"), #' location = "upper" -#' ) +#' )) add_to_ggmatrix <- function( e1, e2, @@ -172,7 +175,7 @@ add_to_ggmatrix <- function( #' \code{\link{ggmatrix}} plot locations #' -#' \Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")} +#' \lifecycle{experimental} #' #' Convert many types of location values to a consistent \code{data.frame} of \code{row} and \code{col} values. #' @@ -232,7 +235,6 @@ add_to_ggmatrix <- function( #' #' # Use the output of a prior ggmatrix_location #' ggmatrix_location(pm, location = locs) -#' ggmatrix_location <- function( pm, location = NULL, diff --git a/R/ggpairs_getput.R b/R/ggpairs_getput.R index 68eea4796..434a65be7 100644 --- a/R/ggpairs_getput.R +++ b/R/ggpairs_getput.R @@ -11,6 +11,9 @@ #' @seealso \code{\link{getPlot}} #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' custom_car <- ggpairs(mtcars[, c("mpg", "wt", "cyl")], upper = "blank", title = "Custom Example") #' # ggplot example taken from example(geom_text) #' plot <- ggplot2::ggplot(mtcars, ggplot2::aes(x=wt, y=mpg, label=rownames(mtcars))) @@ -28,7 +31,7 @@ #' custom_car[2,1] <- NULL #' custom_car[3,1] <- "blank" # the same as storing null #' custom_car[3,2] <- NULL -#' custom_car +#' p_(custom_car) putPlot <- function(pm, value, i, j){ pos <- get_pos(pm, i, j) if (is.null(value)) { @@ -59,9 +62,12 @@ putPlot <- function(pm, value, i, j){ #' @seealso \code{\link{putPlot}} #' @export #' @examples -#' data(tips, package = "reshape") -#' plotMatrix2 <- ggpairs(tips[, 3:2], upper = list(combo = "denstrip")) -#' plotMatrix2[1, 2] +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' +#' data(tips, package = "reshape") +#' plotMatrix2 <- ggpairs(tips[, 3:2], upper = list(combo = "denstrip")) +#' p_(plotMatrix2[1, 2]) getPlot <- function(pm, i, j){ if (FALSE) { cat("i: ", i, " j: ", j, "\n") diff --git a/R/ggpairs_internal_plots.R b/R/ggpairs_internal_plots.R index d7d2e4c85..7a7dfdd57 100644 --- a/R/ggpairs_internal_plots.R +++ b/R/ggpairs_internal_plots.R @@ -108,7 +108,7 @@ wrap_fn_with_param_arg <- function( stop(str_c( "Error retrieving `GGally` function.\n", "Please provide a string such as `'points'` for `ggally_points()`\n", - "For a list of all predefined functions, check out `vignette(\"ggally_plots\", package = \"GGally\")`\n", + "For a list of all predefined functions, check out `vig_ggally(\"ggally_plots\")`\n", "A custom function may be supplied directly: `wrap(my_fn, param = val)`\n", "Function provided: ", funcVal )) diff --git a/R/ggscatmat.R b/R/ggscatmat.R index f708a48a5..e66c8bf83 100644 --- a/R/ggscatmat.R +++ b/R/ggscatmat.R @@ -211,9 +211,13 @@ uppertriangle <- function(data, columns=1:ncol(data), color=NULL, corMethod = "p #' @param alpha an option to set the transparency in scatterplots for large data. Defaults to \code{1}. #' @author Mengjia Ni, Di Cook #' @examples +#' # small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(flea) -#' scatmat(flea, columns=2:4) -#' scatmat(flea, columns= 2:4, color="species") +#' +#' p_(scatmat(flea, columns=2:4)) +#' p_(scatmat(flea, columns= 2:4, color="species")) scatmat <- function(data, columns=1:ncol(data), color=NULL, alpha=1) { data <- upgrade_scatmat_data(data) data.choose <- data[columns] @@ -293,9 +297,13 @@ scatmat <- function(data, columns=1:ncol(data), color=NULL, alpha=1) { #' @param corMethod method argument supplied to \code{\link[stats]{cor}} #' @author Mengjia Ni, Di Cook #' @examples +#' # small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(flea) -#' ggscatmat(flea, columns = 2:4) -#' ggscatmat(flea, columns = 2:4, color = "species") +#' +#' p_(ggscatmat(flea, columns = 2:4)) +#' p_(ggscatmat(flea, columns = 2:4, color = "species")) ggscatmat <- function(data, columns = 1:ncol(data), color = NULL, alpha = 1, corMethod = "pearson"){ ## if 'color' is not a factor, mold it into one if (!is.null(color)) { diff --git a/R/ggsurv.R b/R/ggsurv.R index 1fbb62c23..1b20ec7da 100644 --- a/R/ggsurv.R +++ b/R/ggsurv.R @@ -36,46 +36,48 @@ if(getRversion() >= "2.15.1") { #' @author Edwin Thoen #' @importFrom stats time #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' #' if (require(survival) && require(scales)) { #' data(lung, package = "survival") #' sf.lung <- survival::survfit(Surv(time, status) ~ 1, data = lung) -#' ggsurv(sf.lung) +#' p_(ggsurv(sf.lung)) #' #' # Multiple strata examples #' sf.sex <- survival::survfit(Surv(time, status) ~ sex, data = lung) #' pl.sex <- ggsurv(sf.sex) -#' pl.sex +#' p_(pl.sex) #' #' # Adjusting the legend of the ggsurv fit -#' pl.sex + +#' p_(pl.sex + #' ggplot2::guides(linetype = FALSE) + #' ggplot2::scale_colour_discrete( #' name = 'Sex', #' breaks = c(1,2), #' labels = c('Male', 'Female') -#' ) +#' )) #' #' # Multiple factors #' lung2 <- plyr::mutate(lung, older = as.factor(age > 60)) #' sf.sex2 <- survival::survfit(Surv(time, status) ~ sex + older, data = lung2) #' pl.sex2 <- ggsurv(sf.sex2) -#' pl.sex2 +#' p_(pl.sex2) #' #' # Change legend title -#' pl.sex2 + labs(color = "New Title", linetype = "New Title") +#' p_(pl.sex2 + labs(color = "New Title", linetype = "New Title")) #' #' # We can still adjust the plot after fitting #' data(kidney, package = "survival") #' sf.kid <- survival::survfit(Surv(time, status) ~ disease, data = kidney) #' pl.kid <- ggsurv(sf.kid, plot.cens = FALSE) -#' pl.kid +#' p_(pl.kid) #' #' # Zoom in to first 80 days -#' pl.kid + ggplot2::coord_cartesian(xlim = c(0, 80), ylim = c(0.45, 1)) +#' p_(pl.kid + ggplot2::coord_cartesian(xlim = c(0, 80), ylim = c(0.45, 1))) #' #' # Add the diseases names to the plot and remove legend -#' pl.kid + +#' p_(pl.kid + #' ggplot2::annotate( #' "text", #' label = c("PKD", "Other", "GN", "AN"), @@ -90,7 +92,7 @@ if(getRversion() >= "2.15.1") { #' direction = 1 #' )(4) #' ) + -#' ggplot2::guides(color = FALSE, linetype = FALSE) +#' ggplot2::guides(color = FALSE, linetype = FALSE)) #' } ggsurv <- function( s, diff --git a/R/ggtable.R b/R/ggtable.R index adee7890a..b7f5cf3e8 100644 --- a/R/ggtable.R +++ b/R/ggtable.R @@ -14,28 +14,33 @@ #' @author Joseph Larmarange #' @export #' @examples -#' data(tips, package = "reshape") -#' ggtable(tips, "smoker", c("day", "time", "sex")) +#' # small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' -#' # displaying row proportions -#' ggtable(tips, "smoker", c("day", "time", "sex"), cells = "row.prop") +#' if (require(Hmisc)) { +#' data(tips, package = "reshape") +#' p_(ggtable(tips, "smoker", c("day", "time", "sex"))) #' -#' # filling cells with standardized residuals -#' ggtable(tips, "smoker", c("day", "time", "sex"), fill = "stdres", legend = 1) +#' # displaying row proportions +#' p_(ggtable(tips, "smoker", c("day", "time", "sex"), cells = "row.prop")) #' -#' # if continuous variables are provided, just displaying some summary statistics -#' ggtable(tips, c("smoker", "total_bill"), c("day", "time", "sex", "tip")) +#' # filling cells with standardized residuals +#' p_(ggtable(tips, "smoker", c("day", "time", "sex"), fill = "stdres", legend = 1)) #' -#' # specifying weights -#' d <- as.data.frame(Titanic) -#' ggtable( -#' d, -#' "Survived", -#' c("Class", "Sex", "Age"), -#' mapping = aes(weight = Freq), -#' cells = "row.prop", -#' fill = "stdres" -#' ) +#' # if continuous variables are provided, just displaying some summary statistics +#' p_(ggtable(tips, c("smoker", "total_bill"), c("day", "time", "sex", "tip"))) +#' +#' # specifying weights +#' d <- as.data.frame(Titanic) +#' p_(ggtable( +#' d, +#' "Survived", +#' c("Class", "Sex", "Age"), +#' mapping = aes(weight = Freq), +#' cells = "row.prop", +#' fill = "stdres" +#' )) +#' } ggtable <- function( data, columnsX = 1:ncol(data), diff --git a/R/stat_cross.R b/R/stat_cross.R index 82f9db63c..7876a31f8 100644 --- a/R/stat_cross.R +++ b/R/stat_cross.R @@ -24,51 +24,54 @@ #' #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' d <- as.data.frame(Titanic) #' #' # plot number of observations -#' ggplot(d) + -#' aes(x = Class, y = Survived, weight = Freq, size = after_stat(observed)) + -#' stat_cross() + -#' scale_size_area(max_size = 20) +#' p_(ggplot(d) + +#' aes(x = Class, y = Survived, weight = Freq, size = after_stat(observed)) + +#' stat_cross() + +#' scale_size_area(max_size = 20)) #' #' # custom shape and fill colour based on chi-squared residuals -#' ggplot(d) + -#' aes( -#' x = Class, y = Survived, weight = Freq, -#' size = after_stat(observed), fill = after_stat(stdres) -#' ) + -#' stat_cross(shape = 22) + -#' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + -#' scale_size_area(max_size = 20) +#' p_(ggplot(d) + +#' aes( +#' x = Class, y = Survived, weight = Freq, +#' size = after_stat(observed), fill = after_stat(stdres) +#' ) + +#' stat_cross(shape = 22) + +#' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + +#' scale_size_area(max_size = 20)) #' #' # plotting the number of observations as a table -#' ggplot(d) + -#' aes( -#' x = Class, y = Survived, weight = Freq, label = after_stat(observed) -#' ) + -#' geom_text(stat = "cross") +#' p_(ggplot(d) + +#' aes( +#' x = Class, y = Survived, weight = Freq, label = after_stat(observed) +#' ) + +#' geom_text(stat = "cross")) #' #' # Row proportions with standardized residuals -#' ggplot(d) + +#' p_(ggplot(d) + #' aes( #' x = Class, y = Survived, weight = Freq, #' label = scales::percent(after_stat(row.prop)), -#' size = NULL, fill = after_stat(stdres) +#' size = NULL, fill = after_stat(stdres) #' ) + #' stat_cross(shape = 22, size = 30) + #' geom_text(stat = "cross") + #' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + #' facet_grid(Sex ~ .) + #' labs(fill = "Standardized residuals") + -#' theme_minimal() +#' theme_minimal()) #' #' # can work with continuous or character variables #' data(tips, package = "reshape") -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = tip, y = as.character(day), size = after_stat(observed)) + #' stat_cross(alpha = .1, color = "blue") + -#' scale_size_area(max_size = 12) +#' scale_size_area(max_size = 12)) stat_cross <- function(mapping = NULL, data = NULL, geom = "point", position = "identity", ..., @@ -169,39 +172,42 @@ StatCross <- ggproto("StatCross", Stat, #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_cross(tips, mapping = aes(x = smoker, y = sex)) -#' ggally_cross(tips, mapping = aes(x = day, y = time)) +#' p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex))) +#' p_(ggally_cross(tips, mapping = aes(x = day, y = time))) #' #' # Custom max size -#' ggally_cross(tips, mapping = aes(x = smoker, y = sex)) + -#' scale_size_area(max_size = 40) +#' p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex)) + +#' scale_size_area(max_size = 40)) #' #' # Custom fill -#' ggally_cross(tips, mapping = aes(x = smoker, y = sex), fill = "red") +#' p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex), fill = "red")) #' #' # Custom shape -#' ggally_cross(tips, mapping = aes(x = smoker, y = sex), shape = 21) +#' p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex), shape = 21)) #' #' # Fill squares according to standardized residuals #' d <- as.data.frame(Titanic) -#' ggally_cross( +#' p_(ggally_cross( #' d, #' mapping = aes(x = Class, y = Survived, weight = Freq, fill = after_stat(stdres)) #' ) + -#' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) +#' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE)) #' #' # Add labels -#' ggally_cross( +#' p_(ggally_cross( #' tips, #' mapping = aes( #' x = smoker, y = sex, colour = smoker, #' label = scales::percent(after_stat(prop)) #' ) -#' ) +#' )) #' #' # Customize labels' appearance and same size for all squares -#' ggally_cross( +#' p_(ggally_cross( #' tips, #' mapping = aes( #' x = smoker, y = sex, @@ -211,7 +217,7 @@ StatCross <- ggproto("StatCross", Stat, #' size = 40, # fix value for points size #' fill = "darkblue", #' geom_text_args = list(colour = "white", fontface = "bold", size = 6) -#' ) +#' )) ggally_cross <- function(data, mapping, ..., scale_max_size = 20, geom_text_args = NULL){ mapping <- remove_color_unless_equal(mapping, to = c("x", "y")) mapping <- mapping_color_to_fill(mapping) @@ -265,32 +271,38 @@ ggally_cross <- function(data, mapping, ..., scale_max_size = 20, geom_text_args #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_table(tips, mapping = aes(x = smoker, y = sex)) -#' ggally_table(tips, mapping = aes(x = day, y = time)) -#' ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = smoker)) +#' p_(ggally_table(tips, mapping = aes(x = smoker, y = sex))) +#' p_(ggally_table(tips, mapping = aes(x = day, y = time))) +#' p_(ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = smoker))) #' #' # colour is kept only if equal to x or y -#' ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = day)) +#' p_(ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = day))) #' #' # diagonal version -#' ggally_tableDiag(tips, mapping = aes(x = smoker)) +#' p_(ggally_tableDiag(tips, mapping = aes(x = smoker))) #' #' # custom label size and color -#' ggally_table(tips, mapping = aes(x = smoker, y = sex), size = 16, color = "red") +#' p_(ggally_table(tips, mapping = aes(x = smoker, y = sex), size = 16, color = "red")) #' #' # display column proportions -#' ggally_table(tips, mapping = aes(x = day, y = sex, label = scales::percent(after_stat(col.prop)))) +#' p_(ggally_table( +#' tips, +#' mapping = aes(x = day, y = sex, label = scales::percent(after_stat(col.prop))) +#' )) #' #' # draw table cells -#' ggally_table( +#' p_(ggally_table( #' tips, #' mapping = aes(x = smoker, y = sex), #' geom_tile_args = list(colour = "black", fill = "white") -#' ) +#' )) #' #' # Use standardized residuals to fill table cells -#' ggally_table( +#' p_(ggally_table( #' as.data.frame(Titanic), #' mapping = aes( #' x = Class, y = Survived, weight = Freq, @@ -299,7 +311,7 @@ ggally_cross <- function(data, mapping, ..., scale_max_size = 20, geom_text_args #' ), #' geom_tile_args = list(colour = "black") #' ) + -#' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) +#' scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE)) ggally_table <- function(data, mapping, keep.zero.cells = FALSE, ..., geom_tile_args = NULL){ mapping <- remove_color_unless_equal(mapping, to = c("x", "y")) @@ -347,29 +359,30 @@ ggally_tableDiag <- function(data, mapping, keep.zero.cells = FALSE, ..., geom_t #' @param geom_tile_args other arguments passed to \code{\link[ggplot2]{geom_tile}(...)} #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") #' #' # differences with ggally_table() -#' ggally_table(tips, mapping = aes(x = day, y = time)) -#' ggally_crosstable(tips, mapping = aes(x = day, y = time)) +#' p_(ggally_table(tips, mapping = aes(x = day, y = time))) +#' p_(ggally_crosstable(tips, mapping = aes(x = day, y = time))) #' #' # display column proportions -#' ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "col.prop") +#' p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "col.prop")) #' #' # display row proportions -#' ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "row.prop") +#' p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "row.prop")) #' #' # change size of text -#' ggally_crosstable(tips, mapping = aes(x = day, y = sex), size = 8) +#' p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), size = 8)) #' #' # fill cells with standardized residuals -#' ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres") +#' p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres")) #' -#' \dontrun{ #' # change scale for fill -#' ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres") + -#' scale_fill_steps2(breaks = c(-2, 0, 2), show.limits = TRUE) -#' } +#' p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres") + +#' scale_fill_steps2(breaks = c(-2, 0, 2), show.limits = TRUE)) ggally_crosstable <- function( data, mapping, diff --git a/R/stat_prop.R b/R/stat_prop.R index 8ce0f3c4b..f53a7ed6c 100644 --- a/R/stat_prop.R +++ b/R/stat_prop.R @@ -22,6 +22,8 @@ #' @author Joseph Larmarange #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive #' #' d <- as.data.frame(Titanic) #' @@ -29,26 +31,25 @@ #' aes(x = Class, fill = Survived, weight = Freq, by = Class) + #' geom_bar(position = "fill") + #' geom_text(stat = "prop", position = position_fill(.5)) -#' p -#' p + facet_grid(~ Sex) +#' p_(p) +#' p_(p + facet_grid(~ Sex)) #' -#' ggplot(d) + +#' p_(ggplot(d) + #' aes(x = Class, fill = Survived, weight = Freq) + #' geom_bar(position = "dodge") + #' geom_text( #' aes(by = Survived), stat = "prop", #' position = position_dodge(0.9), vjust = "bottom" -#' ) +#' )) #' -#' ggplot(d) + +#' p_(ggplot(d) + #' aes(x = Class, fill = Survived, weight = Freq, by = 1) + #' geom_bar() + #' geom_text( #' aes(label = scales::percent(after_stat(prop), accuracy = 1)), #' stat = "prop", #' position = position_stack(.5) -#' ) -#' +#' )) stat_prop <- function( mapping = NULL, data = NULL, @@ -142,32 +143,35 @@ StatProp <- ggproto("StatProp", Stat, #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") -#' ggally_colbar(tips, mapping = aes(x = smoker, y = sex)) -#' ggally_rowbar(tips, mapping = aes(x = smoker, y = sex)) +#' p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex))) +#' p_(ggally_rowbar(tips, mapping = aes(x = smoker, y = sex))) #' #' # change labels' size -#' ggally_colbar(tips, mapping = aes(x = smoker, y = sex), size = 8) +#' p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), size = 8)) #' #' # change labels' colour and use bold -#' ggally_colbar(tips, mapping = aes(x = smoker, y = sex), -#' colour = "white", fontface = "bold") +#' p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), +#' colour = "white", fontface = "bold")) #' #' # custom bar width -#' ggally_colbar(tips, mapping = aes(x = smoker, y = sex), geom_bar_args = list(width = .5)) +#' p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), geom_bar_args = list(width = .5))) #' #' # change format of labels -#' ggally_colbar(tips, mapping = aes(x = smoker, y = sex), -#' label_format = scales::label_percent(accuracy = .01, decimal.mark = ",")) +#' p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), +#' label_format = scales::label_percent(accuracy = .01, decimal.mark = ","))) #' -#' ggduo( +#' p_(ggduo( #' data = as.data.frame(Titanic), #' mapping = aes(weight = Freq), #' columnsX = "Survived", #' columnsY = c("Sex", "Class", "Age"), #' types = list(discrete = "rowbar"), #' legend = 1 -#' ) +#' )) ggally_colbar <- function( data, mapping, diff --git a/R/stat_weighted_mean.R b/R/stat_weighted_mean.R index 7b9a83245..0b7a4ad71 100644 --- a/R/stat_weighted_mean.R +++ b/R/stat_weighted_mean.R @@ -14,41 +14,44 @@ #' @inheritParams ggplot2::stat_bin #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") #' -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = day, y = total_bill) + -#' geom_point() +#' geom_point()) #' -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = day, y = total_bill) + -#' stat_weighted_mean() +#' stat_weighted_mean()) #' -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = day, y = total_bill, group = 1) + -#' stat_weighted_mean(geom = "line") +#' stat_weighted_mean(geom = "line")) #' -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = day, y = total_bill, colour = sex, group = sex) + -#' stat_weighted_mean(geom = "line") +#' stat_weighted_mean(geom = "line")) #' -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = day, y = total_bill, fill = sex) + -#' stat_weighted_mean(geom = "bar", position = "dodge") +#' stat_weighted_mean(geom = "bar", position = "dodge")) #' #' # computing a proportion on the fly -#' ggplot(tips) + +#' p_(ggplot(tips) + #' aes(x = day, y = as.integer(smoker == "Yes"), fill = sex) + #' stat_weighted_mean(geom = "bar", position = "dodge") + -#' scale_y_continuous(labels = scales::percent) +#' scale_y_continuous(labels = scales::percent)) #' #' # taking into account some weights #' d <- as.data.frame(Titanic) -#' ggplot(d) + +#' p_(ggplot(d) + #' aes(x = Class, y = as.integer(Survived == "Yes"), weight = Freq, fill = Sex) + #' geom_bar(stat = "weighted_mean", position = "dodge") + #' scale_y_continuous(labels = scales::percent) + -#' labs(y = "Survived") +#' labs(y = "Survived")) #' #' #' \dontrun{ @@ -147,37 +150,39 @@ StatWeightedMean <- ggproto( #' @keywords hplot #' @export #' @examples +#' # Small function to display plots only if it's interactive +#' p_ <- GGally::print_if_interactive +#' #' data(tips, package = "reshape") #' tips_f <- tips #' tips_f$day <- factor(tips$day, c("Thur", "Fri", "Sat", "Sun")) #' #' # Numeric variable -#' ggally_trends(tips_f, mapping = aes(x = day, y = total_bill)) -#' ggally_trends(tips_f, mapping = aes(x = day, y = total_bill, colour = time)) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = total_bill))) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = total_bill, colour = time))) #' #' # Binary variable -#' ggally_trends(tips_f, mapping = aes(x = day, y = smoker)) -#' ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex)) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker))) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex))) #' #' # Discrete variable with 3 or more categories -#' ggally_trends(tips_f, mapping = aes(x = smoker, y = day)) -#' ggally_trends(tips_f, mapping = aes(x = smoker, y = day, color = sex)) +#' p_(ggally_trends(tips_f, mapping = aes(x = smoker, y = day))) +#' p_(ggally_trends(tips_f, mapping = aes(x = smoker, y = day, color = sex))) #' #' # Include zero on Y axis -#' ggally_trends(tips_f, mapping = aes(x = day, y = total_bill), include_zero = TRUE) -#' ggally_trends(tips_f, mapping = aes(x = day, y = smoker), include_zero = TRUE) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = total_bill), include_zero = TRUE)) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker), include_zero = TRUE)) #' #' # Change line size -#' ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex), size = 3) +#' p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex), size = 3)) #' #' # Define weights with the appropriate aesthetic #' d <- as.data.frame(Titanic) -#' ggally_trends( +#' p_(ggally_trends( #' d, #' mapping = aes(x = Class, y = Survived, weight = Freq, color = Sex), #' include_zero = TRUE -#' ) -#' +#' )) ggally_trends <- function( data, mapping, diff --git a/R/vig_ggally.R b/R/vig_ggally.R new file mode 100644 index 000000000..a7513a540 --- /dev/null +++ b/R/vig_ggally.R @@ -0,0 +1,51 @@ +#' View \pkg{GGally} vignettes +#' +#' This function will open the directly to the vignette requested. If no \code{name} is provided, the index of all \pkg{GGally} vignettes will be opened. +#' +#' This method allows for vignettes to be hosted remotely, reducing \pkg{GGally}'s package size, and installation time. +#' +#' @param name Vignette name to open. If no name is provided, the vignette index will be opened +#' @export +#' @examples +#' \donttest{ +#' # View `ggnostic` vignette +#' vig_ggally("ggnostic") +#' +#' # View all vignettes by GGally +#' vig_ggally()} +vig_ggally <- function(name) { + + vig_url <- + if (missing(name) || is.null(name)) { + "https://ggobi.github.io/ggally/articles/" + } else { + tryCatch({ + paste0( + "https://ggobi.github.io/ggally/articles/", + match.arg(name, vignettes_for_ggally), + ".html" + ) + }, error = function(e) { + message("Unknown vignette: ", name, ". Opening Vignette index page") + "https://ggobi.github.io/ggally/articles/" + }) + } + + browseURL(vig_url) +} + +vignettes_for_ggally <- c( + "ggally_plots", + "ggally_stats", + "ggbivariate", + "ggcoef", + "ggduo", + "ggmatrix", + "ggnetworkmap", + "ggnostic", + "ggpairs", + "ggscatmat", + "ggsurv", + "ggtable", + "glyph" +) diff --git a/_pkgdown.yml b/_pkgdown.yml index 99c9d3203..e6bed066e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -24,11 +24,43 @@ authors: Hadley Wickham: href: http://hadley.nz/ +articles: +- title: Generic plot matrix + navbar: Generic plot matrix + # desc: description here + contents: + - ggpairs + - ggduo + - ggmatrix + - ggally_plots + +- title: Specialized plot matrix + navbar: Specialized plot matrix + # desc: description here + contents: + - ggbivariate + - ggnostic + - ggscatmat + - ggtable + - ggally_stats + +- title: Specialized ggplot2 plot + navbar: Specialized ggplot2 plot + # desc: description here + contents: + - ggcoef + - ggnetworkmap + - ggsurv + - glyph + reference: - title: Plot Matrix desc: > - More details in `vignette("ggpairs")`, `vignette("ggmatrix")` and `vignette("ggscatmat")` + More details in + [`vig_ggally("ggpairs")`](https://ggobi.github.io/ggally/articles/ggpairs.html), + [`vig_ggally("ggmatrix")`](https://ggobi.github.io/ggally/articles/ggmatrix.html), + and [`vig_ggally("ggscatmat")`](https://ggobi.github.io/ggally/articles/ggscatmat.html) contents: - ggmatrix - ggpairs @@ -39,8 +71,9 @@ reference: - title: High-Level Plots desc: > - See `vignette("ggally_plots")` for a list with examples - of all high-level plots. + See + [`vig_ggally("ggally_plots")`](https://ggobi.github.io/ggally/articles/ggally_plots.html) + for a list with examples of all high-level plots. contents: - ggally_autopoint - ggally_barDiag @@ -72,7 +105,11 @@ reference: - title: Major Plotting Functions desc: > - More details in `vignette("ggbivariate")`, `vignette("ggcoef")`, `vignette("ggsurv")`, and `vignette("ggtable")` + More details in + [`vig_ggally("ggbivariate")`](https://ggobi.github.io/ggally/articles/ggbivariate.html), + [`vig_ggally("ggcoef")`](https://ggobi.github.io/ggally/articles/ggcoef.html), + [`vig_ggally("ggsurv")`](https://ggobi.github.io/ggally/articles/ggsurv.html), + and [`vig_ggally("ggtable")`](https://ggobi.github.io/ggally/articles/ggtable.html) contents: - ggbivariate - ggcoef @@ -83,7 +120,8 @@ reference: - title: Modeling Diagnostics desc: > - More details in `vignette("ggnostic")` + More details in + [`vig_ggally("ggnostic")`](https://ggobi.github.io/ggally/articles/ggpairs.html) contents: - ggnostic - broomify @@ -97,7 +135,8 @@ reference: - title: Glyph Plot desc: > - More details in `vignette("glyph")` + More details in + [`vig_ggally("glyph")`](https://ggobi.github.io/ggally/articles/glyph.html) contents: - glyphs - add_ref_boxes @@ -107,7 +146,8 @@ reference: - title: Network Plots desc: > - More details in `vignette("ggnetworkmap")` + More details in + [`vig_ggally("ggnetworkmap")`](https://ggobi.github.io/ggally/articles/ggnetworkmap.html) contents: - ggnet - ggnet2 @@ -115,7 +155,8 @@ reference: - title: Additional Statistics for `ggplot2` desc: > - More details in `vignette("ggally_stats")` + More details in + [`vig_ggally("ggally_stats")`](https://ggobi.github.io/ggally/articles/ggally_stats.html) contents: - stat_cross - stat_prop @@ -123,7 +164,7 @@ reference: - title: "ggmatrix() Helpers" contents: - - eval_data_col + - +.gg - ggmatrix_location - wrap_fn_with_param_arg - getPlot @@ -131,15 +172,15 @@ reference: - fn_switch - grab_legend - gglegend - - ggmatrix_progress + - eval_data_col - mapping_swap_x_y - mapping_color_to_fill - remove_color_unless_equal - print.ggmatrix - ggmatrix_gtable - - print_if_interactive + - ggmatrix_progress - str.ggmatrix - - +.gg + - print_if_interactive - title: Utilities contents: @@ -155,6 +196,7 @@ reference: - skewness - signif_stars - uppertriangle + - vig_ggally - title: Datasets contents: diff --git a/cran-comments.md b/cran-comments.md index ab4895588..abccb3ce8 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,9 +1,11 @@ ## Comments -### 2020-3-19 +### 2020-6-5 -I've fixed the tests and the package now works with the latest (and prior) ggplot2 versions. +I have renamed the offending functions. + +I have rerun package checks and revdep checks and updated the final results below. (tl/dr 0 revdep problems & 0 errors | 0 warnings | 0 notes) Please let me know if there is anything else I can do. @@ -11,55 +13,131 @@ Best, Barret -### 2020-3-6 +### 2020-6-5 + +I talked with Joseph (co-author and author of the conflicting function names). We are going to change our function names and resubmit. This seems like the safest approach all around. + +Thank you for your time and patience. + +Best, +Barret + + +### 2020-6-5 + +Changes to worse in reverse depends: + +Package: robustSingleCell +Check: whether package can be installed +New result: WARNING + + + Found the following significant warnings: + Warning: replacing previous import ‘GGally::mean_sd’ by ‘ggpubr::mean_sd’ when loading ‘robustSingleCell’ + Warning: replacing previous import ‘GGally::median_iqr’ by ‘ggpubr::median_iqr’ when loading ‘robustSingleCell’ + +- CRAN teams' auto-check service + + +### 2020-6-4 + +Changes since last submission: +* I removed the package vignettes (and will only host them on the package's website). +* I have altered the examples to only print the ggplot2 images if they are in an interactive session. +* I have made some of the longer running tests to be CI only. (On a weekly schedule) + +The package size should be smaller (I did not receive any warnings) and the check time should be faster. + +I have rerun package checks and revdep checks and updated the final results below. + +Please let me know if there is anything else I can do. + +Best, +Barret + + +### 2020-6-4 + +Thanks, we see: + -Dear maintainer, + Size of tarball: 5726242 bytes -Please see the problems shown on -. +This is more than the 5MB CRAN threshhold and more than ever before? -Please correct before 2020-03-20 to safely retain your package on CRAN. + +Flavor: r-devel-windows-ix86+x86_64 +Check: Overall checktime, Result: NOTE + Overall checktime 14 min > 10 min + +This is also rather extensive. + + +Can these be reduced? + +Best, +Uwe Ligges + + +### 2020-6-3 + +I have removed `packagedocs` as a dependency. This fixes the errors on CRAN check. + +With the removal of `packagedocs` and switching to true vignettes, the package size has grown a bit due to the nature of having vignettes containing **many** `ggplot2` images. + +Please let me know if there is anything else I can do. Best, --k +Barret + +### 2020-5-20 -#### Test environments and R CMD check results +Package `lazyrmd` is orphaned. -* local macOS install 10.15.3 - * R 3.6.3 -* travis-ci ubuntu - * oldrelease, R version 3.5.3 (2017-01-27) - * release, R version 3.6.2 (2017-01-27) - * devel, R Under development (unstable) (2020-03-13 r77948) +Package `packagedocs` requires it, which is not allowed under the CRAN policy. -* rhub - * Windows Server 2008 R2 SP1, R-devel, 32/64 bit - * Ubuntu Linux 16.04 LTS, R-release, GCC - * Fedora Linux, R-devel, clang, gfortran +Packages `GGally` and `geofacet` suggest `packagedocs` but do not use it +conditionally. + +We need one of + +a) `lazyrmd` to be maintained (as we have asked before) or +b) `packagedocs` to work without lazyrmd or +c) `lazyrmd` and `packagedocs` to be archived and `geofacet`/`GGally` use a +different vignette builder. + +Please resolve one way or the other before Jun 3. + +-- +Brian D. Ripley + + + +## Test environments and R CMD check results + +* local macOS install 10.15.5 + * R 4.0 +* GitHub Actions - https://github.com/ggobi/ggally/pull/364/checks + * macOS, windows - R devel + * macOS, windows, ubuntu 16 - R 4.0 + * macOS, windows, ubuntu 16 - R 3.6 * win-builder * oldrelease * release - * devel - - + * devel - Could not test. `Failed FTP upload: 550` #### R CMD check results -rhub - Fedora R-devel -* 0 errors | 0 warnings | 1 note -* checking package dependencies ... NOTE - Package suggested but not available for checking: ‘scagnostics’ - -Everything else * 0 errors | 0 warnings | 0 notes - ## revdepcheck results -We checked 89 reverse dependencies (72 from CRAN + 17 from BioConductor), comparing R CMD check results across CRAN and dev versions of this package. +Link: https://github.com/ggobi/ggally/blob/rc-v2.0.0/revdep/README.md + +We checked 98 reverse dependencies (77 from CRAN + 21 from BioConductor), comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/man/getPlot.Rd b/man/getPlot.Rd index 2a1f4dbf0..f2bceed00 100644 --- a/man/getPlot.Rd +++ b/man/getPlot.Rd @@ -22,9 +22,12 @@ getPlot(pm, i, j) Retrieves the ggplot object at the desired location. } \examples{ - data(tips, package = "reshape") - plotMatrix2 <- ggpairs(tips[, 3:2], upper = list(combo = "denstrip")) - plotMatrix2[1, 2] +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +plotMatrix2 <- ggpairs(tips[, 3:2], upper = list(combo = "denstrip")) +p_(plotMatrix2[1, 2]) } \seealso{ \code{\link{putPlot}} diff --git a/man/gg-add.Rd b/man/gg-add.Rd index 6b0a7d6a6..3a4685990 100644 --- a/man/gg-add.Rd +++ b/man/gg-add.Rd @@ -54,29 +54,32 @@ with elements from e2. only some subplots. This function may be replaced and/or removed in the future. \Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")} } \examples{ +# small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive data(tips, package = "reshape") + pm <- ggpairs(tips[, 2:4], ggplot2::aes(color = sex)) ## change to black and white theme pm + ggplot2::theme_bw() ## change to linedraw theme -# pm + ggplot2::theme_linedraw() +p_(pm + ggplot2::theme_linedraw()) ## change to custom theme -# pm + ggplot2::theme(panel.background = ggplot2::element_rect(fill = "lightblue")) +p_(pm + ggplot2::theme(panel.background = ggplot2::element_rect(fill = "lightblue"))) ## add a list of information extra <- list(ggplot2::theme_bw(), ggplot2::labs(caption = "My caption!")) -pm + extra +p_(pm + extra) ## modify scale -pm + scale_fill_brewer(type = "qual") +p_(pm + scale_fill_brewer(type = "qual")) ## only first row -add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), rows = 1:2) +p_(add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), rows = 1:2)) ## only second col -add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), cols = 2:3) +p_(add_to_ggmatrix(pm, scale_fill_brewer(type = "qual"), cols = 2:3)) ## only to upper triangle of plot matrix -add_to_ggmatrix( +p_(add_to_ggmatrix( pm, scale_fill_brewer(type = "qual"), location = "upper" -) +)) } \seealso{ \code{\link[ggplot2]{+.gg}} and \code{\link[ggplot2]{theme}} diff --git a/man/ggally_autopoint.Rd b/man/ggally_autopoint.Rd index 5b6394862..894da16fd 100644 --- a/man/ggally_autopoint.Rd +++ b/man/ggally_autopoint.Rd @@ -21,22 +21,23 @@ Make scatterplots compatible with both continuous and categorical variables using \code{\link[ggforce]{geom_autopoint}} from package \pkg{ggforce}. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_autopoint(tips, mapping = aes(x = tip, y = total_bill)) -ggally_autopoint(tips, mapping = aes(x = tip, y = sex)) -ggally_autopoint(tips, mapping = aes(x = smoker, y = sex)) -ggally_autopoint(tips, mapping = aes(x = smoker, y = sex, color = day)) -ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), size = 8) -ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), alpha = .9) +p_(ggally_autopoint(tips, mapping = aes(x = tip, y = total_bill))) +p_(ggally_autopoint(tips, mapping = aes(x = tip, y = sex))) +p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex))) +p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex, color = day))) +p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), size = 8)) +p_(ggally_autopoint(tips, mapping = aes(x = smoker, y = sex), alpha = .9)) -\dontrun{ -ggpairs( +p_(ggpairs( tips, mapping = aes(colour = sex), upper = list(discrete = "autopoint", combo = "autopoint", continuous = "autopoint"), diag = list(discrete = "autopointDiag", continuous = "autopointDiag") -) -} +)) } \author{ Joseph Larmarange diff --git a/man/ggally_barDiag.Rd b/man/ggally_barDiag.Rd index 263c75246..61bec4edb 100644 --- a/man/ggally_barDiag.Rd +++ b/man/ggally_barDiag.Rd @@ -19,9 +19,12 @@ ggally_barDiag(data, mapping, ..., rescale = FALSE) Displays a bar plot for the diagonal of a \code{\link{ggpairs}} plot matrix. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_barDiag(tips, mapping = ggplot2::aes(x = day)) -ggally_barDiag(tips, mapping = ggplot2::aes(x = tip), binwidth = 0.25) +p_(ggally_barDiag(tips, mapping = ggplot2::aes(x = day))) +p_(ggally_barDiag(tips, mapping = ggplot2::aes(x = tip), binwidth = 0.25)) } \author{ Barret Schloerke diff --git a/man/ggally_box.Rd b/man/ggally_box.Rd index 7d5bb08f0..d743ba281 100644 --- a/man/ggally_box.Rd +++ b/man/ggally_box.Rd @@ -20,16 +20,19 @@ ggally_box_no_facet(data, mapping, ...) Make a box plot with a given data set. \code{ggally_box_no_facet} will be a single panel plot, while \code{ggally_box} will be a faceted plot } \examples{ - data(tips, package = "reshape") - ggally_box(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) - ggally_box(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex")) - ggally_box( - tips, - mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex"), - outlier.colour = "red", - outlier.shape = 13, - outlier.size = 8 - ) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_box(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +p_(ggally_box(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))) +p_(ggally_box( + tips, + mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex"), + outlier.colour = "red", + outlier.shape = 13, + outlier.size = 8 +)) } \author{ Barret Schloerke diff --git a/man/ggally_colbar.Rd b/man/ggally_colbar.Rd index 386f9b75b..7b8de08d0 100644 --- a/man/ggally_colbar.Rd +++ b/man/ggally_colbar.Rd @@ -44,32 +44,35 @@ ggally_rowbar( Plot column or row percentage using bar plots. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_colbar(tips, mapping = aes(x = smoker, y = sex)) -ggally_rowbar(tips, mapping = aes(x = smoker, y = sex)) +p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex))) +p_(ggally_rowbar(tips, mapping = aes(x = smoker, y = sex))) # change labels' size -ggally_colbar(tips, mapping = aes(x = smoker, y = sex), size = 8) +p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), size = 8)) # change labels' colour and use bold -ggally_colbar(tips, mapping = aes(x = smoker, y = sex), - colour = "white", fontface = "bold") +p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), + colour = "white", fontface = "bold")) # custom bar width -ggally_colbar(tips, mapping = aes(x = smoker, y = sex), geom_bar_args = list(width = .5)) +p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), geom_bar_args = list(width = .5))) # change format of labels -ggally_colbar(tips, mapping = aes(x = smoker, y = sex), - label_format = scales::label_percent(accuracy = .01, decimal.mark = ",")) +p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex), + label_format = scales::label_percent(accuracy = .01, decimal.mark = ","))) -ggduo( +p_(ggduo( data = as.data.frame(Titanic), mapping = aes(weight = Freq), columnsX = "Survived", columnsY = c("Sex", "Class", "Age"), types = list(discrete = "rowbar"), legend = 1 -) +)) } \author{ Joseph Larmarange diff --git a/man/ggally_cor.Rd b/man/ggally_cor.Rd index 496ec2a56..97ab6e318 100644 --- a/man/ggally_cor.Rd +++ b/man/ggally_cor.Rd @@ -61,28 +61,31 @@ ggally_cor( Estimate correlation from the given data. If a color variable is supplied, the correlation will also be calculated per group. } \examples{ - data(tips, package = "reshape") - ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) - # display with grid - ggally_cor( - tips, - mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), - display_grid = TRUE - ) - # change text attributes - ggally_cor( - tips, - mapping = ggplot2::aes(x = total_bill, y = tip), - size = 15, - colour = I("red"), - title = "Correlation" - ) - # split by a variable - ggally_cor( - tips, - mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), - size = 5 - ) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +# display with grid +p_(ggally_cor( + tips, + mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), + display_grid = TRUE +)) +# change text attributes +p_(ggally_cor( + tips, + mapping = ggplot2::aes(x = total_bill, y = tip), + size = 15, + colour = I("red"), + title = "Correlation" +)) +# split by a variable +p_(ggally_cor( + tips, + mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), + size = 5 +)) } \seealso{ \code{\link{ggally_statistic}}, \code{\link{ggally_cor_v1_5}} diff --git a/man/ggally_cor_v1_5.Rd b/man/ggally_cor_v1_5.Rd index 33afb70b8..e25bd8c7f 100644 --- a/man/ggally_cor_v1_5.Rd +++ b/man/ggally_cor_v1_5.Rd @@ -45,27 +45,33 @@ ggally_cor_v1_5( Estimate correlation from the given data. } \examples{ - data(tips, package = "reshape") - ggally_cor_v1_5(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) - # display with no grid - ggally_cor_v1_5( - tips, - mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), - displayGrid = FALSE - ) - # change text attributes - ggally_cor_v1_5( - tips, - mapping = ggplot2::aes(x = total_bill, y = tip), - size = 15, - colour = I("red") - ) - # split by a variable - ggally_cor_v1_5( - tips, - mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), - size = 5 - ) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_cor_v1_5(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) + +# display with no grid +p_(ggally_cor_v1_5( + tips, + mapping = ggplot2::aes_string(x = "total_bill", y = "tip"), + displayGrid = FALSE +)) + +# change text attributes +p_(ggally_cor_v1_5( + tips, + mapping = ggplot2::aes(x = total_bill, y = tip), + size = 15, + colour = I("red") +)) + +# split by a variable +p_(ggally_cor_v1_5( + tips, + mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"), + size = 5 +)) } \seealso{ \code{\link{ggally_cor}} diff --git a/man/ggally_count.Rd b/man/ggally_count.Rd index 912bf5ab1..a360a2672 100644 --- a/man/ggally_count.Rd +++ b/man/ggally_count.Rd @@ -27,22 +27,27 @@ with proportional areas. You can adjust the size of rectangles with the \code{x.width} argument. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex)) -ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex, fill = day)) +p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex))) +p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex, fill = day))) -ggally_count( +p_(ggally_count( as.data.frame(Titanic), mapping = ggplot2::aes(x = Class, y = Survived, weight = Freq) -) -ggally_count( +)) +p_(ggally_count( as.data.frame(Titanic), mapping = ggplot2::aes(x = Class, y = Survived, weight = Freq), x.width = 0.5 -) +)) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive -ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker)) -ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker, fill = sex)) +p_(ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker))) +p_(ggally_countDiag(tips, mapping = ggplot2::aes(x = smoker, fill = sex))) } \author{ Joseph Larmarange diff --git a/man/ggally_cross.Rd b/man/ggally_cross.Rd index 1b35eda30..8e7520b67 100644 --- a/man/ggally_cross.Rd +++ b/man/ggally_cross.Rd @@ -24,39 +24,42 @@ statistics computed by \code{\link{stat_cross}}. Labels could also be added (see examples). } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_cross(tips, mapping = aes(x = smoker, y = sex)) -ggally_cross(tips, mapping = aes(x = day, y = time)) +p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex))) +p_(ggally_cross(tips, mapping = aes(x = day, y = time))) # Custom max size -ggally_cross(tips, mapping = aes(x = smoker, y = sex)) + - scale_size_area(max_size = 40) +p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex)) + + scale_size_area(max_size = 40)) # Custom fill -ggally_cross(tips, mapping = aes(x = smoker, y = sex), fill = "red") +p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex), fill = "red")) # Custom shape -ggally_cross(tips, mapping = aes(x = smoker, y = sex), shape = 21) +p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex), shape = 21)) # Fill squares according to standardized residuals d <- as.data.frame(Titanic) -ggally_cross( +p_(ggally_cross( d, mapping = aes(x = Class, y = Survived, weight = Freq, fill = after_stat(stdres)) ) + - scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE)) # Add labels -ggally_cross( +p_(ggally_cross( tips, mapping = aes( x = smoker, y = sex, colour = smoker, label = scales::percent(after_stat(prop)) ) -) +)) # Customize labels' appearance and same size for all squares -ggally_cross( +p_(ggally_cross( tips, mapping = aes( x = smoker, y = sex, @@ -66,7 +69,7 @@ ggally_cross( size = 40, # fix value for points size fill = "darkblue", geom_text_args = list(colour = "white", fontface = "bold", size = 6) -) +)) } \author{ Joseph Larmarange diff --git a/man/ggally_crosstable.Rd b/man/ggally_crosstable.Rd index c85dcefbc..3a28c2442 100644 --- a/man/ggally_crosstable.Rd +++ b/man/ggally_crosstable.Rd @@ -31,27 +31,28 @@ ggally_crosstable( \code{ggally_crosstable} is a variation of \code{\link{ggally_table}} with few modifications: (i) table cells are drawn; (ii) x and y axis are not expanded (and therefore are not aligned with other \code{ggally_*} plots); (iii) content and fill of cells can be easily controlled with dedicated arguments. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") # differences with ggally_table() -ggally_table(tips, mapping = aes(x = day, y = time)) -ggally_crosstable(tips, mapping = aes(x = day, y = time)) +p_(ggally_table(tips, mapping = aes(x = day, y = time))) +p_(ggally_crosstable(tips, mapping = aes(x = day, y = time))) # display column proportions -ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "col.prop") +p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "col.prop")) # display row proportions -ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "row.prop") +p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "row.prop")) # change size of text -ggally_crosstable(tips, mapping = aes(x = day, y = sex), size = 8) +p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), size = 8)) # fill cells with standardized residuals -ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres") +p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres")) -\dontrun{ # change scale for fill -ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres") + - scale_fill_steps2(breaks = c(-2, 0, 2), show.limits = TRUE) -} +p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "stdres") + + scale_fill_steps2(breaks = c(-2, 0, 2), show.limits = TRUE)) } diff --git a/man/ggally_density.Rd b/man/ggally_density.Rd index d885008d3..ca20999d2 100644 --- a/man/ggally_density.Rd +++ b/man/ggally_density.Rd @@ -20,17 +20,20 @@ Make a 2D density plot from a given data. The aesthetic "fill" determines whether or not \code{stat_density2d} (filled) or \code{geom_density2d} (lines) is used. } \examples{ - data(tips, package = "reshape") - ggally_density(tips, mapping = ggplot2::aes(x = total_bill, y = tip)) - ggally_density(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) - ggally_density( - tips, - mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") - ) - ggally_density( - tips, - mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") - ) + ggplot2::scale_fill_gradient(breaks = c(0.05, 0.1, 0.15, 0.2)) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_density(tips, mapping = ggplot2::aes(x = total_bill, y = tip))) +p_(ggally_density(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +p_(ggally_density( + tips, + mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") +)) +p_(ggally_density( + tips, + mapping = ggplot2::aes_string(x = "total_bill", y = "tip", fill = "..level..") +) + ggplot2::scale_fill_gradient(breaks = c(0.05, 0.1, 0.15, 0.2))) } \author{ Barret Schloerke diff --git a/man/ggally_densityDiag.Rd b/man/ggally_densityDiag.Rd index cbedf583c..0f8d975af 100644 --- a/man/ggally_densityDiag.Rd +++ b/man/ggally_densityDiag.Rd @@ -19,9 +19,12 @@ ggally_densityDiag(data, mapping, ..., rescale = FALSE) Displays a density plot for the diagonal of a \code{\link{ggpairs}} plot matrix. } \examples{ - data(tips, package = "reshape") - ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill)) - ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill, color = day)) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill))) +p_(ggally_densityDiag(tips, mapping = ggplot2::aes(x = total_bill, color = day))) } \author{ Barret Schloerke diff --git a/man/ggally_denstrip.Rd b/man/ggally_denstrip.Rd index 8c3023fdd..48b5ca2f9 100644 --- a/man/ggally_denstrip.Rd +++ b/man/ggally_denstrip.Rd @@ -17,13 +17,16 @@ ggally_denstrip(data, mapping, ...) Displays a Tile Plot as densely as possible. } \examples{ - data(tips, package = "reshape") - ggally_denstrip(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) - ggally_denstrip(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex")) - ggally_denstrip( - tips, - mapping = ggplot2::aes_string(x = "sex", y = "tip", binwidth = "0.2") - ) + ggplot2::scale_fill_gradient(low = "grey80", high = "black") +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_denstrip(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +p_(ggally_denstrip(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))) +p_(ggally_denstrip( + tips, + mapping = ggplot2::aes_string(x = "sex", y = "tip", binwidth = "0.2") +) + ggplot2::scale_fill_gradient(low = "grey80", high = "black")) } \author{ Barret Schloerke diff --git a/man/ggally_diagAxis.Rd b/man/ggally_diagAxis.Rd index 93b533f39..c3a38a8e0 100644 --- a/man/ggally_diagAxis.Rd +++ b/man/ggally_diagAxis.Rd @@ -42,9 +42,12 @@ ggally_diagAxis( This function is used when \code{axisLabels == "internal"}. } \examples{ - data(tips, package = "reshape") - ggally_diagAxis(tips, ggplot2::aes(x=tip)) - ggally_diagAxis(tips, ggplot2::aes(x=sex)) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_diagAxis(tips, ggplot2::aes(x=tip))) +p_(ggally_diagAxis(tips, ggplot2::aes(x=sex))) } \author{ Jason Crowley and Barret Schloerke diff --git a/man/ggally_dot.Rd b/man/ggally_dot.Rd index 7044d0ac7..1693e45f0 100644 --- a/man/ggally_dot.Rd +++ b/man/ggally_dot.Rd @@ -20,17 +20,20 @@ ggally_dot_no_facet(data, mapping, ...) Add jittering with the box plot. \code{ggally_dot_no_facet} will be a single panel plot, while \code{ggally_dot} will be a faceted plot } \examples{ - data(tips, package = "reshape") - ggally_dot(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) - ggally_dot(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex")) - ggally_dot( - tips, - mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") - ) - ggally_dot( - tips, - mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex", shape = "sex") - ) + ggplot2::scale_shape(solid=FALSE) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_dot(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +p_(ggally_dot(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "sex"))) +p_(ggally_dot( + tips, + mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") +)) +p_(ggally_dot( + tips, + mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex", shape = "sex") +) + ggplot2::scale_shape(solid=FALSE)) } \author{ Barret Schloerke diff --git a/man/ggally_dot_and_box.Rd b/man/ggally_dot_and_box.Rd index 9ac823f25..bfedf0bd9 100644 --- a/man/ggally_dot_and_box.Rd +++ b/man/ggally_dot_and_box.Rd @@ -19,17 +19,20 @@ ggally_dot_and_box(data, mapping, ..., boxPlot = TRUE) Place box plots or dot plots on the graph } \examples{ - data(tips, package = "reshape") - ggally_dot_and_box( - tips, - mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), - boxPlot = TRUE - ) - ggally_dot_and_box( - tips, - mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), - boxPlot = FALSE - ) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_dot_and_box( + tips, + mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), + boxPlot = TRUE +)) +p_(ggally_dot_and_box( + tips, + mapping = ggplot2::aes(x = total_bill, y = sex, color = sex), + boxPlot = FALSE +)) } \author{ Barret Schloerke diff --git a/man/ggally_facetbar.Rd b/man/ggally_facetbar.Rd index 80962a879..cef320886 100644 --- a/man/ggally_facetbar.Rd +++ b/man/ggally_facetbar.Rd @@ -17,9 +17,12 @@ ggally_facetbar(data, mapping, ...) X variables are plotted using \code{geom_bar} and are faceted by the Y variable. } \examples{ - data(tips, package = "reshape") - ggally_facetbar(tips, ggplot2::aes(x = sex, y = smoker, fill = time)) - ggally_facetbar(tips, ggplot2::aes(x = smoker, y = sex, fill = time)) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_facetbar(tips, ggplot2::aes(x = sex, y = smoker, fill = time))) +p_(ggally_facetbar(tips, ggplot2::aes(x = smoker, y = sex, fill = time))) } \author{ Barret Schloerke diff --git a/man/ggally_facetdensity.Rd b/man/ggally_facetdensity.Rd index 1966df305..3228a510d 100644 --- a/man/ggally_facetdensity.Rd +++ b/man/ggally_facetdensity.Rd @@ -17,12 +17,15 @@ ggally_facetdensity(data, mapping, ...) Make density plots by displaying subsets of the data in different panels. } \examples{ - data(tips, package = "reshape") - ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex)) - ggally_facetdensity( - tips, - mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") - ) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex))) +p_(ggally_facetdensity( + tips, + mapping = ggplot2::aes_string(y = "total_bill", x = "sex", color = "sex") +)) } \author{ Barret Schloerke diff --git a/man/ggally_facethist.Rd b/man/ggally_facethist.Rd index 1c3605170..3e8903a74 100644 --- a/man/ggally_facethist.Rd +++ b/man/ggally_facethist.Rd @@ -17,9 +17,12 @@ ggally_facethist(data, mapping, ...) Display subsetted histograms of the data in different panels. } \examples{ - data(tips, package = "reshape") - ggally_facethist(tips, mapping = ggplot2::aes(x = tip, y = sex)) - ggally_facethist(tips, mapping = ggplot2::aes_string(x = "tip", y = "sex"), binwidth = 0.1) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_facethist(tips, mapping = ggplot2::aes(x = tip, y = sex))) +p_(ggally_facethist(tips, mapping = ggplot2::aes_string(x = "tip", y = "sex"), binwidth = 0.1)) } \author{ Barret Schloerke diff --git a/man/ggally_nostic_cooksd.Rd b/man/ggally_nostic_cooksd.Rd index 81224702c..33a204c8e 100644 --- a/man/ggally_nostic_cooksd.Rd +++ b/man/ggally_nostic_cooksd.Rd @@ -31,8 +31,11 @@ A line is added at F_{p, n - p}(0.5) to display the general cutoff point for Coo Reference: Michael H. Kutner, Christopher J. Nachtsheim, John Neter, and William Li. Applied linear statistical models. The McGraw-Hill / Irwin series operations and decision sciences. McGraw-Hill Irwin, 2005, p. 403 } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -ggally_nostic_cooksd(dt, ggplot2::aes(wt, .cooksd)) +p_(ggally_nostic_cooksd(dt, ggplot2::aes(wt, .cooksd))) } \seealso{ \code{stats::\link[stats]{cooks.distance}} diff --git a/man/ggally_nostic_hat.Rd b/man/ggally_nostic_hat.Rd index acaf4d396..b347b5faa 100644 --- a/man/ggally_nostic_hat.Rd +++ b/man/ggally_nostic_hat.Rd @@ -44,8 +44,11 @@ A suggested "cutoff" line is added to the plot at a height of 2 * p / n and an e If either \code{linePosition} or \code{avgLinePosition} is \code{NULL}, the respective line will not be drawn. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -ggally_nostic_hat(dt, ggplot2::aes(wt, .hat)) +p_(ggally_nostic_hat(dt, ggplot2::aes(wt, .hat))) } \seealso{ \code{stats::\link[stats]{influence}} diff --git a/man/ggally_nostic_resid.Rd b/man/ggally_nostic_resid.Rd index fea5f9391..a6d811f0d 100644 --- a/man/ggally_nostic_resid.Rd +++ b/man/ggally_nostic_resid.Rd @@ -46,8 +46,11 @@ ggally_nostic_resid( If non-null \code{pVal} and \code{sigma} values are given, confidence interval lines will be added to the plot at the specified \code{pVal} percentiles of a N(0, sigma) distribution. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -ggally_nostic_resid(dt, ggplot2::aes(wt, .resid)) +p_(ggally_nostic_resid(dt, ggplot2::aes(wt, .resid))) } \seealso{ \code{stats::\link[stats]{residuals}} diff --git a/man/ggally_nostic_se_fit.Rd b/man/ggally_nostic_se_fit.Rd index c3af9c402..4ea776256 100644 --- a/man/ggally_nostic_se_fit.Rd +++ b/man/ggally_nostic_se_fit.Rd @@ -33,8 +33,11 @@ Since the se.fit is \code{TRUE} and scale is unset by default, the standard erro A base line of 0 is added to give reference to a perfect fit. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -ggally_nostic_se_fit(dt, ggplot2::aes(wt, .se.fit)) +p_(ggally_nostic_se_fit(dt, ggplot2::aes(wt, .se.fit))) } \seealso{ \code{stats::\link[stats]{influence}} diff --git a/man/ggally_nostic_sigma.Rd b/man/ggally_nostic_sigma.Rd index 6623fafcc..824e4ebff 100644 --- a/man/ggally_nostic_sigma.Rd +++ b/man/ggally_nostic_sigma.Rd @@ -31,8 +31,11 @@ sigma: a vector whose i-th element contains the estimate of the residual standar A line is added to display the overall model's sigma value. This gives a baseline for comparison } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -ggally_nostic_sigma(dt, ggplot2::aes(wt, .sigma)) +p_(ggally_nostic_sigma(dt, ggplot2::aes(wt, .sigma))) } \seealso{ \code{stats::\link[stats]{influence}} diff --git a/man/ggally_nostic_std_resid.Rd b/man/ggally_nostic_std_resid.Rd index 53a1c97d9..33e19b25d 100644 --- a/man/ggally_nostic_std_resid.Rd +++ b/man/ggally_nostic_std_resid.Rd @@ -18,8 +18,11 @@ ggally_nostic_std_resid(data, mapping, ..., sigma = 1) If non-null \code{pVal} and \code{sigma} values are given, confidence interval lines will be added to the plot at the specified \code{pVal} locations of a N(0, 1) distribution. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + dt <- broomify(stats::lm(mpg ~ wt + qsec + am, data = mtcars)) -ggally_nostic_std_resid(dt, ggplot2::aes(wt, .std.resid)) +p_(ggally_nostic_std_resid(dt, ggplot2::aes(wt, .std.resid))) } \seealso{ \code{stats::\link[stats]{rstandard}} diff --git a/man/ggally_points.Rd b/man/ggally_points.Rd index 4759ef647..6c410f092 100644 --- a/man/ggally_points.Rd +++ b/man/ggally_points.Rd @@ -17,10 +17,13 @@ ggally_points(data, mapping, ...) Make a scatter plot with a given data set. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(mtcars) -ggally_points(mtcars, mapping = ggplot2::aes(x = disp, y = hp)) -ggally_points(mtcars, mapping = ggplot2::aes_string(x = "disp", y = "hp")) -ggally_points( +p_(ggally_points(mtcars, mapping = ggplot2::aes(x = disp, y = hp))) +p_(ggally_points(mtcars, mapping = ggplot2::aes_string(x = "disp", y = "hp"))) +p_(ggally_points( mtcars, mapping = ggplot2::aes_string( x = "disp", @@ -28,7 +31,7 @@ ggally_points( color = "as.factor(cyl)", size = "gear" ) -) +)) } \author{ Barret Schloerke diff --git a/man/ggally_ratio.Rd b/man/ggally_ratio.Rd index 43c004733..d8eff8348 100644 --- a/man/ggally_ratio.Rd +++ b/man/ggally_ratio.Rd @@ -27,14 +27,17 @@ ggally_ratio( Plots the mosaic plot by using fluctuation. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_ratio(tips, ggplot2::aes(sex, day)) -ggally_ratio(tips, ggplot2::aes(sex, day)) + ggplot2::coord_equal() +p_(ggally_ratio(tips, ggplot2::aes(sex, day))) +p_(ggally_ratio(tips, ggplot2::aes(sex, day)) + ggplot2::coord_equal()) # only plot tiles greater or equal to 20 and scale to a max of 50 -ggally_ratio( +p_(ggally_ratio( tips, ggplot2::aes(sex, day), floor = 20, ceiling = 50 -) + ggplot2::theme(aspect.ratio = 4/2) +) + ggplot2::theme(aspect.ratio = 4/2)) } \author{ Barret Schloerke diff --git a/man/ggally_smooth.Rd b/man/ggally_smooth.Rd index 03360c2a4..e4582e890 100644 --- a/man/ggally_smooth.Rd +++ b/man/ggally_smooth.Rd @@ -38,10 +38,13 @@ Add a smoothed condition mean with a given scatter plot. Y limits are reduced to match original Y range with the goal of keeping the Y axis the same across plots. } \examples{ - data(tips, package = "reshape") - ggally_smooth(tips, mapping = ggplot2::aes(x = total_bill, y = tip)) - ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")) - ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex")) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(tips, package = "reshape") +p_(ggally_smooth(tips, mapping = ggplot2::aes(x = total_bill, y = tip))) +p_(ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))) +p_(ggally_smooth(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"))) } \author{ Barret Schloerke diff --git a/man/ggally_summarise_by.Rd b/man/ggally_summarise_by.Rd index 3fbb3bec7..4542f44aa 100644 --- a/man/ggally_summarise_by.Rd +++ b/man/ggally_summarise_by.Rd @@ -42,27 +42,32 @@ Display summary statistics of a continuous variable for each value of a discrete \code{weighted_mean_sd} computes weighted mean and standard deviation. } \examples{ -data(tips, package = "reshape") -ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day)) -ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill)) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive -# colour is kept only if equal to the discrete variable -ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = day)) -ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = sex)) -ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill, color = day)) +if (require(Hmisc)) { + data(tips, package = "reshape") + p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day))) + p_(ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill))) -# custom text size -ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), size = 6) + # colour is kept only if equal to the discrete variable + p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = day))) + p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day, color = sex))) + p_(ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill, color = day))) -# change statistic to display -ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_mean_sd) + # custom text size + p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), size = 6)) -# custom stat function -weighted_sum <- function(x, weights = NULL) { - if (is.null(weights)) weights <- 1 - paste0("Total : ", round(sum(x * weights, na.rm = TRUE), digits = 1)) + # change statistic to display + p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_mean_sd)) + + # custom stat function + weighted_sum <- function(x, weights = NULL) { + if (is.null(weights)) weights <- 1 + paste0("Total : ", round(sum(x * weights, na.rm = TRUE), digits = 1)) + } + p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_sum)) } -ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day), text_fn = weighted_sum) } \author{ Joseph Larmarange diff --git a/man/ggally_table.Rd b/man/ggally_table.Rd index aeb290366..5967c675f 100644 --- a/man/ggally_table.Rd +++ b/man/ggally_table.Rd @@ -41,32 +41,38 @@ The \strong{colour} aesthetic is taken into account only if equal to \strong{x} or \strong{y}. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggally_table(tips, mapping = aes(x = smoker, y = sex)) -ggally_table(tips, mapping = aes(x = day, y = time)) -ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = smoker)) +p_(ggally_table(tips, mapping = aes(x = smoker, y = sex))) +p_(ggally_table(tips, mapping = aes(x = day, y = time))) +p_(ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = smoker))) # colour is kept only if equal to x or y -ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = day)) +p_(ggally_table(tips, mapping = aes(x = smoker, y = sex, colour = day))) # diagonal version -ggally_tableDiag(tips, mapping = aes(x = smoker)) +p_(ggally_tableDiag(tips, mapping = aes(x = smoker))) # custom label size and color -ggally_table(tips, mapping = aes(x = smoker, y = sex), size = 16, color = "red") +p_(ggally_table(tips, mapping = aes(x = smoker, y = sex), size = 16, color = "red")) # display column proportions -ggally_table(tips, mapping = aes(x = day, y = sex, label = scales::percent(after_stat(col.prop)))) +p_(ggally_table( + tips, + mapping = aes(x = day, y = sex, label = scales::percent(after_stat(col.prop))) +)) # draw table cells -ggally_table( +p_(ggally_table( tips, mapping = aes(x = smoker, y = sex), geom_tile_args = list(colour = "black", fill = "white") -) +)) # Use standardized residuals to fill table cells -ggally_table( +p_(ggally_table( as.data.frame(Titanic), mapping = aes( x = Class, y = Survived, weight = Freq, @@ -75,7 +81,7 @@ ggally_table( ), geom_tile_args = list(colour = "black") ) + -scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) +scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE)) } \author{ Joseph Larmarange diff --git a/man/ggally_text.Rd b/man/ggally_text.Rd index 57dada971..22a55ae2b 100644 --- a/man/ggally_text.Rd +++ b/man/ggally_text.Rd @@ -33,8 +33,11 @@ ggally_text( Plot text for a plot. } \examples{ -ggally_text("Example 1") -ggally_text("Example\nTwo", mapping = ggplot2::aes(size = 15), color = I("red")) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +p_(ggally_text("Example 1")) +p_(ggally_text("Example\nTwo", mapping = ggplot2::aes(size = 15), color = I("red"))) } \author{ Barret Schloerke diff --git a/man/ggally_trends.Rd b/man/ggally_trends.Rd index 8d90bd500..a73126639 100644 --- a/man/ggally_trends.Rd +++ b/man/ggally_trends.Rd @@ -21,37 +21,39 @@ For continuous y variables, plot the evolution of the mean. For binary y variables, plot the evolution of the proportion. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") tips_f <- tips tips_f$day <- factor(tips$day, c("Thur", "Fri", "Sat", "Sun")) # Numeric variable -ggally_trends(tips_f, mapping = aes(x = day, y = total_bill)) -ggally_trends(tips_f, mapping = aes(x = day, y = total_bill, colour = time)) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = total_bill))) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = total_bill, colour = time))) # Binary variable -ggally_trends(tips_f, mapping = aes(x = day, y = smoker)) -ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex)) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker))) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex))) # Discrete variable with 3 or more categories -ggally_trends(tips_f, mapping = aes(x = smoker, y = day)) -ggally_trends(tips_f, mapping = aes(x = smoker, y = day, color = sex)) +p_(ggally_trends(tips_f, mapping = aes(x = smoker, y = day))) +p_(ggally_trends(tips_f, mapping = aes(x = smoker, y = day, color = sex))) # Include zero on Y axis -ggally_trends(tips_f, mapping = aes(x = day, y = total_bill), include_zero = TRUE) -ggally_trends(tips_f, mapping = aes(x = day, y = smoker), include_zero = TRUE) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = total_bill), include_zero = TRUE)) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker), include_zero = TRUE)) # Change line size -ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex), size = 3) +p_(ggally_trends(tips_f, mapping = aes(x = day, y = smoker, colour = sex), size = 3)) # Define weights with the appropriate aesthetic d <- as.data.frame(Titanic) -ggally_trends( +p_(ggally_trends( d, mapping = aes(x = Class, y = Survived, weight = Freq, color = Sex), include_zero = TRUE -) - +)) } \author{ Joseph Larmarange diff --git a/man/ggbivariate.Rd b/man/ggbivariate.Rd index 656dc74ec..5d3d0397e 100644 --- a/man/ggbivariate.Rd +++ b/man/ggbivariate.Rd @@ -38,23 +38,25 @@ weights (see examples)} an outcome variable with several potential explanatory variables. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")) +p_(ggbivariate(tips, "smoker", c("day", "time", "sex", "tip"))) -\dontrun{ # Personalize plot title and legend title -ggbivariate( +p_(ggbivariate( tips, "smoker", c("day", "time", "sex", "tip"), title = "Custom title" ) + - labs(fill = "Smoker ?") + labs(fill = "Smoker ?")) # Customize fill colour scale -ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")) + - scale_fill_brewer(type = "qual") +p_(ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")) + + scale_fill_brewer(type = "qual")) # Customize labels -ggbivariate( +p_(ggbivariate( tips, "smoker", c("day", "time", "sex", "tip"), rowbar_args = list( colour = "white", @@ -62,19 +64,18 @@ ggbivariate( fontface = "bold", label_format = scales::label_percent(accurary = 1) ) -) +)) # Choose the sub-plot from which get legend -ggbivariate(tips, "smoker") -ggbivariate(tips, "smoker", legend = 3) +p_(ggbivariate(tips, "smoker")) +p_(ggbivariate(tips, "smoker", legend = 3)) # Use mapping to indicate weights d <- as.data.frame(Titanic) -ggbivariate(d, "Survived", mapping = aes(weight = Freq)) +p_(ggbivariate(d, "Survived", mapping = aes(weight = Freq))) # outcome can be numerical -ggbivariate(tips, outcome = "tip", title = "tip") -} +p_(ggbivariate(tips, outcome = "tip", title = "tip")) } \author{ Joseph Larmarange diff --git a/man/ggcoef.Rd b/man/ggcoef.Rd index dc6c8d2d0..c6bd578cc 100644 --- a/man/ggcoef.Rd +++ b/man/ggcoef.Rd @@ -66,9 +66,12 @@ if \code{x} is not a data frame)} Plot the coefficients of a model with \pkg{broom} and \pkg{ggplot2}. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + library(broom) reg <- lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data = iris) -ggcoef(reg) +p_(ggcoef(reg)) \donttest{d <- as.data.frame(Titanic) reg2 <- glm(Survived ~ Sex + Age + Class, family = binomial, data = d, weights = d$Freq) ggcoef(reg2, exponentiate = TRUE) diff --git a/man/ggcorr.Rd b/man/ggcorr.Rd index 564ed50ef..f8aa556eb 100644 --- a/man/ggcorr.Rd +++ b/man/ggcorr.Rd @@ -147,19 +147,22 @@ Recommended values for the \code{nbreaks} argument are \code{3} to supported by diverging ColorBrewer palettes. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + # Basketball statistics provided by Nathan Yau at Flowing Data. dt <- read.csv("http://datasets.flowingdata.com/ppg2008.csv") # Default output. -ggcorr(dt[, -1]) +p_(ggcorr(dt[, -1])) -# Labelled output, with coefficient transparency. -ggcorr(dt[, -1], +# Labeled output, with coefficient transparency. +p_(ggcorr(dt[, -1], label = TRUE, - label_alpha = TRUE) + label_alpha = TRUE)) # Custom options. -ggcorr( +p_(ggcorr( dt[, -1], name = expression(rho), geom = "circle", @@ -170,13 +173,13 @@ ggcorr( nbreaks = 6, angle = -45, palette = "PuOr" # colorblind safe, photocopy-able -) +)) # Supply your own correlation matrix -ggcorr( +p_(ggcorr( data = NULL, cor_matrix = cor(dt[, -1], use = "pairwise") -) +)) } \seealso{ \code{\link[stats]{cor}} and \code{corrplot} in the diff --git a/man/ggduo.Rd b/man/ggduo.Rd index e111ad5f3..718f303b6 100644 --- a/man/ggduo.Rd +++ b/man/ggduo.Rd @@ -130,7 +130,7 @@ If a function is supplied as an option, it should implement the function api of continuous = wrap("smooth_loess", alpha = 0.50, shape = "+") ), showStrips = FALSE - ); + ) p_(pm) diff --git a/man/gglegend.Rd b/man/gglegend.Rd index 6a9be51d8..639c977e6 100644 --- a/man/gglegend.Rd +++ b/man/gglegend.Rd @@ -16,12 +16,15 @@ a function that when called with arguments will produce the legend of the plotti Plot only legend of plot function } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + # display regular plot -ggally_points(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) +p_(ggally_points(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species))) # Make a function that will only print the legend points_legend <- gglegend(ggally_points) -points_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) +p_(points_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species))) # produce the sample legend plot, but supply a string that 'wrap' understands same_points_legend <- gglegend("points") @@ -32,7 +35,7 @@ identical( # Complicated examples custom_legend <- wrap(gglegend("points"), size = 6) -custom_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) +p_(custom_legend(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species))) # Use within ggpairs pm <- ggpairs( @@ -40,11 +43,11 @@ pm <- ggpairs( mapping = ggplot2::aes(color = Species), upper = list(continuous = gglegend("points")) ) -# pm +p_(pm) # Place a legend in a specific location pm <- ggpairs(iris, 1:2, mapping = ggplot2::aes(color = Species)) # Make the legend pm[1,2] <- points_legend(iris, ggplot2::aes(Sepal.Width, Sepal.Length, color = Species)) -pm +p_(pm) } diff --git a/man/ggmatrix.Rd b/man/ggmatrix.Rd index d31cc37be..a5f17412f 100644 --- a/man/ggmatrix.Rd +++ b/man/ggmatrix.Rd @@ -66,7 +66,7 @@ Now that the \code{\link{print.ggmatrix}} method uses a large \pkg{gtable} objec } \examples{ -# small function to display plots only if it's interactive +# Small function to display plots only if it's interactive p_ <- GGally::print_if_interactive plotList <- list() diff --git a/man/ggmatrix_location.Rd b/man/ggmatrix_location.Rd index 2012e42e1..567103609 100644 --- a/man/ggmatrix_location.Rd +++ b/man/ggmatrix_location.Rd @@ -32,7 +32,7 @@ ggmatrix_location(pm, location = NULL, rows = NULL, cols = NULL) Data frame with columns \code{c("row", "col")} containing locations for the plot matrix } \description{ -\Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")} +\lifecycle{experimental} } \details{ Convert many types of location values to a consistent \code{data.frame} of \code{row} and \code{col} values. @@ -74,5 +74,4 @@ locs # Use the output of a prior ggmatrix_location ggmatrix_location(pm, location = locs) - } diff --git a/man/ggnet.Rd b/man/ggnet.Rd index a0820d992..ef25384de 100644 --- a/man/ggnet.Rd +++ b/man/ggnet.Rd @@ -205,6 +205,9 @@ but will be unweighted. To compute weighted network measures, see the \code{tnet} package by Tore Opsahl (\code{help("tnet", package = "tnet")}). } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + library(network) # random adjacency matrix @@ -229,10 +232,10 @@ g # color palette p <- c("a" = "steelblue", "b" = "forestgreen", "c" = "tomato") -ggnet(n, node.group = g, node.color = p, label = TRUE, color = "white") +p_(ggnet(n, node.group = g, node.color = p, label = TRUE, color = "white")) # edge arrows on a directed network -ggnet(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10) +p_(ggnet(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10)) } \seealso{ \code{\link{ggnet2}} in this package, diff --git a/man/ggnet2.Rd b/man/ggnet2.Rd index 23fcc4268..2da339861 100644 --- a/man/ggnet2.Rd +++ b/man/ggnet2.Rd @@ -293,6 +293,9 @@ The nodes of bipartite networks can be mapped to their mode by passing the \code{"event"}. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + library(network) # random adjacency matrix @@ -308,42 +311,42 @@ m n <- network::network(m, directed = FALSE) n -ggnet2(n, label = TRUE) -ggnet2(n, label = TRUE, shape = 15) -ggnet2(n, label = TRUE, shape = 15, color = "black", label.color = "white") +p_(ggnet2(n, label = TRUE)) +p_(ggnet2(n, label = TRUE, shape = 15)) +p_(ggnet2(n, label = TRUE, shape = 15, color = "black", label.color = "white")) # add vertex attribute x = network.vertex.names(n) x = ifelse(x \%in\% c("a", "e", "i"), "vowel", "consonant") n \%v\% "phono" = x -ggnet2(n, color = "phono") -ggnet2(n, color = "phono", palette = c("vowel" = "gold", "consonant" = "grey")) -ggnet2(n, shape = "phono", color = "phono") +p_(ggnet2(n, color = "phono")) +p_(ggnet2(n, color = "phono", palette = c("vowel" = "gold", "consonant" = "grey"))) +p_(ggnet2(n, shape = "phono", color = "phono")) if (require(RColorBrewer)) { # random groups n \%v\% "group" <- sample(LETTERS[1:3], 10, replace = TRUE) - ggnet2(n, color = "group", palette = "Set2") + p_(ggnet2(n, color = "group", palette = "Set2")) } # random weights n \%e\% "weight" <- sample(1:3, network.edgecount(n), replace = TRUE) -ggnet2(n, edge.size = "weight", edge.label = "weight") +p_(ggnet2(n, edge.size = "weight", edge.label = "weight")) # edge arrows on a directed network -ggnet2(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10) +p_(ggnet2(network(m, directed = TRUE), arrow.gap = 0.05, arrow.size = 10)) # Padgett's Florentine wedding data data(flo, package = "network") flo -ggnet2(flo, label = TRUE) -ggnet2(flo, label = TRUE, label.trim = 4, vjust = -1, size = 3, color = 1) -ggnet2(flo, label = TRUE, size = 12, color = "white") +p_(ggnet2(flo, label = TRUE)) +p_(ggnet2(flo, label = TRUE, label.trim = 4, vjust = -1, size = 3, color = 1)) +p_(ggnet2(flo, label = TRUE, size = 12, color = "white")) } \seealso{ \code{\link{ggnet}} in this package, diff --git a/man/ggpairs.Rd b/man/ggpairs.Rd index 2db4c03ec..e3117da21 100644 --- a/man/ggpairs.Rd +++ b/man/ggpairs.Rd @@ -97,8 +97,8 @@ If 'blank' is ever chosen as an option, then ggpairs will produce an empty plot. If a function is supplied as an option to \code{upper}, \code{lower}, or \code{diag}, it should implement the function api of \code{function(data, mapping, ...){#make ggplot2 plot}}. If a specific function needs its parameters set, \code{\link{wrap}(fn, param1 = val1, param2 = val2)} the function with its parameters. } \examples{ - # small function to display plots only if it's interactive - p_ <- GGally::print_if_interactive +# small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive ## Quick example, with and without colour diff --git a/man/ggscatmat.Rd b/man/ggscatmat.Rd index 7376f41d2..04d92b9ea 100644 --- a/man/ggscatmat.Rd +++ b/man/ggscatmat.Rd @@ -29,9 +29,13 @@ This function makes a scatterplot matrix for quantitative variables with density and correlation printed in the upper triangle. } \examples{ +# small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(flea) -ggscatmat(flea, columns = 2:4) -ggscatmat(flea, columns = 2:4, color = "species") + +p_(ggscatmat(flea, columns = 2:4)) +p_(ggscatmat(flea, columns = 2:4, color = "species")) } \author{ Mengjia Ni, Di Cook diff --git a/man/ggsurv.Rd b/man/ggsurv.Rd index 0aedfb611..4d29759e3 100644 --- a/man/ggsurv.Rd +++ b/man/ggsurv.Rd @@ -72,46 +72,48 @@ As a first argument it needs a \code{survfit} object, created by the multiple strata objects. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive if (require(survival) && require(scales)) { data(lung, package = "survival") sf.lung <- survival::survfit(Surv(time, status) ~ 1, data = lung) - ggsurv(sf.lung) + p_(ggsurv(sf.lung)) # Multiple strata examples sf.sex <- survival::survfit(Surv(time, status) ~ sex, data = lung) pl.sex <- ggsurv(sf.sex) - pl.sex + p_(pl.sex) # Adjusting the legend of the ggsurv fit - pl.sex + + p_(pl.sex + ggplot2::guides(linetype = FALSE) + ggplot2::scale_colour_discrete( name = 'Sex', breaks = c(1,2), labels = c('Male', 'Female') - ) + )) # Multiple factors lung2 <- plyr::mutate(lung, older = as.factor(age > 60)) sf.sex2 <- survival::survfit(Surv(time, status) ~ sex + older, data = lung2) pl.sex2 <- ggsurv(sf.sex2) - pl.sex2 + p_(pl.sex2) # Change legend title - pl.sex2 + labs(color = "New Title", linetype = "New Title") + p_(pl.sex2 + labs(color = "New Title", linetype = "New Title")) # We can still adjust the plot after fitting data(kidney, package = "survival") sf.kid <- survival::survfit(Surv(time, status) ~ disease, data = kidney) pl.kid <- ggsurv(sf.kid, plot.cens = FALSE) - pl.kid + p_(pl.kid) # Zoom in to first 80 days - pl.kid + ggplot2::coord_cartesian(xlim = c(0, 80), ylim = c(0.45, 1)) + p_(pl.kid + ggplot2::coord_cartesian(xlim = c(0, 80), ylim = c(0.45, 1))) # Add the diseases names to the plot and remove legend - pl.kid + + p_(pl.kid + ggplot2::annotate( "text", label = c("PKD", "Other", "GN", "AN"), @@ -126,7 +128,7 @@ if (require(survival) && require(scales)) { direction = 1 )(4) ) + - ggplot2::guides(color = FALSE, linetype = FALSE) + ggplot2::guides(color = FALSE, linetype = FALSE)) } } \author{ diff --git a/man/ggtable.Rd b/man/ggtable.Rd index 5ee4509d4..aa348f3af 100644 --- a/man/ggtable.Rd +++ b/man/ggtable.Rd @@ -35,28 +35,33 @@ weights (see examples)} cross-tabulated tables of discrete variables. } \examples{ -data(tips, package = "reshape") -ggtable(tips, "smoker", c("day", "time", "sex")) +# small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive -# displaying row proportions -ggtable(tips, "smoker", c("day", "time", "sex"), cells = "row.prop") +if (require(Hmisc)) { + data(tips, package = "reshape") + p_(ggtable(tips, "smoker", c("day", "time", "sex"))) -# filling cells with standardized residuals -ggtable(tips, "smoker", c("day", "time", "sex"), fill = "stdres") + # displaying row proportions + p_(ggtable(tips, "smoker", c("day", "time", "sex"), cells = "row.prop")) -# if continuous variables are provided, just displaying some summary statistics -ggtable(tips, c("smoker", "total_bill"), c("day", "time", "sex", "tip")) + # filling cells with standardized residuals + p_(ggtable(tips, "smoker", c("day", "time", "sex"), fill = "stdres", legend = 1)) -# specifying weights -d <- as.data.frame(Titanic) -ggtable( - d, - "Survived", - c("Class", "Sex", "Age"), - mapping = aes(weight = Freq), - cells = "row.prop", - fill = "stdres" -) + # if continuous variables are provided, just displaying some summary statistics + p_(ggtable(tips, c("smoker", "total_bill"), c("day", "time", "sex", "tip"))) + + # specifying weights + d <- as.data.frame(Titanic) + p_(ggtable( + d, + "Survived", + c("Class", "Sex", "Age"), + mapping = aes(weight = Freq), + cells = "row.prop", + fill = "stdres" + )) +} } \author{ Joseph Larmarange diff --git a/man/ggts.Rd b/man/ggts.Rd index fbf3496b0..d7e6621e8 100644 --- a/man/ggts.Rd +++ b/man/ggts.Rd @@ -20,5 +20,8 @@ ggts(..., columnLabelsX = NULL, xlab = "time") GGally implementation of ts.plot. Wraps around the ggduo function and removes the column strips } \examples{ -ggts(pigs, "time", c("gilts", "profit", "s_per_herdsz", "production", "herdsz")) +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +p_(ggts(pigs, "time", c("gilts", "profit", "s_per_herdsz", "production", "herdsz"))) } diff --git a/man/glyphs.Rd b/man/glyphs.Rd index f37917f7d..e2534f74a 100644 --- a/man/glyphs.Rd +++ b/man/glyphs.Rd @@ -39,21 +39,24 @@ that no scaling is performed.} Create the data needed to generate a glyph plot. } \examples{ - data(nasa) - nasaLate <- nasa[ - nasa$date >= as.POSIXct("1998-01-01") & - nasa$lat >= 20 & - nasa$lat <= 40 & - nasa$long >= -80 & - nasa$long <= -60 - , ] - temp.gly <- glyphs(nasaLate, "long", "day", "lat", "surftemp", height=2.5) - ggplot2::ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) + - add_ref_lines(temp.gly, color = "grey90") + - add_ref_boxes(temp.gly, color = "grey90") + - ggplot2::geom_path() + - ggplot2::theme_bw() + - ggplot2::labs(x = "", y = "") +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + +data(nasa) +nasaLate <- nasa[ + nasa$date >= as.POSIXct("1998-01-01") & + nasa$lat >= 20 & + nasa$lat <= 40 & + nasa$long >= -80 & + nasa$long <= -60 +, ] +temp.gly <- glyphs(nasaLate, "long", "day", "lat", "surftemp", height=2.5) +p_(ggplot2::ggplot(temp.gly, ggplot2::aes(gx, gy, group = gid)) + + add_ref_lines(temp.gly, color = "grey90") + + add_ref_boxes(temp.gly, color = "grey90") + + ggplot2::geom_path() + + ggplot2::theme_bw() + + ggplot2::labs(x = "", y = "")) } \author{ Di Cook, Heike Hofmann, Hadley Wickham diff --git a/man/grab_legend.Rd b/man/grab_legend.Rd index 398cd0de0..297c6ce20 100644 --- a/man/grab_legend.Rd +++ b/man/grab_legend.Rd @@ -22,6 +22,9 @@ grab_legend(p) Grab the legend and print it as a plot } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + library(ggplot2) histPlot <- qplot( x = Sepal.Length, @@ -35,8 +38,8 @@ histPlot <- qplot( (top <- histPlot + theme(legend.position = "top")) (left <- histPlot + theme(legend.position = "left")) -grab_legend(right) -grab_legend(bottom) -grab_legend(top) -grab_legend(left) +p_(grab_legend(right)) +p_(grab_legend(bottom)) +p_(grab_legend(top)) +p_(grab_legend(left)) } diff --git a/man/putPlot.Rd b/man/putPlot.Rd index 025e86000..1bbfaf183 100644 --- a/man/putPlot.Rd +++ b/man/putPlot.Rd @@ -24,6 +24,9 @@ putPlot(pm, value, i, j) Function to place your own plot in the layout. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + custom_car <- ggpairs(mtcars[, c("mpg", "wt", "cyl")], upper = "blank", title = "Custom Example") # ggplot example taken from example(geom_text) plot <- ggplot2::ggplot(mtcars, ggplot2::aes(x=wt, y=mpg, label=rownames(mtcars))) @@ -41,7 +44,7 @@ custom_car[1, 3] <- personal_plot custom_car[2,1] <- NULL custom_car[3,1] <- "blank" # the same as storing null custom_car[3,2] <- NULL -custom_car +p_(custom_car) } \seealso{ \code{\link{getPlot}} diff --git a/man/scatmat.Rd b/man/scatmat.Rd index 0d479328e..6f498aa78 100644 --- a/man/scatmat.Rd +++ b/man/scatmat.Rd @@ -19,9 +19,13 @@ scatmat(data, columns = 1:ncol(data), color = NULL, alpha = 1) Function for making scatterplots in the lower triangle and diagonal density plots. } \examples{ +# small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(flea) -scatmat(flea, columns=2:4) -scatmat(flea, columns= 2:4, color="species") + +p_(scatmat(flea, columns=2:4)) +p_(scatmat(flea, columns= 2:4, color="species")) } \author{ Mengjia Ni, Di Cook diff --git a/man/stat_cross.Rd b/man/stat_cross.Rd index e54912a1f..8e8fae41d 100644 --- a/man/stat_cross.Rd +++ b/man/stat_cross.Rd @@ -89,50 +89,53 @@ from \pkg{broom}. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + d <- as.data.frame(Titanic) # plot number of observations -ggplot(d) + - aes(x = Class, y = Survived, weight = Freq, size = after_stat(observed)) + - stat_cross() + - scale_size_area(max_size = 20) +p_(ggplot(d) + + aes(x = Class, y = Survived, weight = Freq, size = after_stat(observed)) + + stat_cross() + + scale_size_area(max_size = 20)) # custom shape and fill colour based on chi-squared residuals -ggplot(d) + - aes( - x = Class, y = Survived, weight = Freq, - size = after_stat(observed), fill = after_stat(stdres) - ) + - stat_cross(shape = 22) + - scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + - scale_size_area(max_size = 20) +p_(ggplot(d) + + aes( + x = Class, y = Survived, weight = Freq, + size = after_stat(observed), fill = after_stat(stdres) + ) + + stat_cross(shape = 22) + + scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + + scale_size_area(max_size = 20)) # plotting the number of observations as a table -ggplot(d) + - aes( - x = Class, y = Survived, weight = Freq, label = after_stat(observed) - ) + - geom_text(stat = "cross") +p_(ggplot(d) + + aes( + x = Class, y = Survived, weight = Freq, label = after_stat(observed) + ) + + geom_text(stat = "cross")) # Row proportions with standardized residuals -ggplot(d) + +p_(ggplot(d) + aes( x = Class, y = Survived, weight = Freq, label = scales::percent(after_stat(row.prop)), - size = NULL, fill = after_stat(stdres) + size = NULL, fill = after_stat(stdres) ) + stat_cross(shape = 22, size = 30) + geom_text(stat = "cross") + scale_fill_steps2(breaks = c(-3, -2, 2, 3), show.limits = TRUE) + facet_grid(Sex ~ .) + labs(fill = "Standardized residuals") + - theme_minimal() + theme_minimal()) # can work with continuous or character variables data(tips, package = "reshape") -ggplot(tips) + +p_(ggplot(tips) + aes(x = tip, y = as.character(day), size = after_stat(observed)) + stat_cross(alpha = .1, color = "blue") + - scale_size_area(max_size = 12) + scale_size_area(max_size = 12)) } \keyword{datasets} diff --git a/man/stat_prop.Rd b/man/stat_prop.Rd index dc66ca32a..d8d4c93c5 100644 --- a/man/stat_prop.Rd +++ b/man/stat_prop.Rd @@ -87,6 +87,8 @@ should be a factor. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive d <- as.data.frame(Titanic) @@ -94,26 +96,25 @@ p <- ggplot(d) + aes(x = Class, fill = Survived, weight = Freq, by = Class) + geom_bar(position = "fill") + geom_text(stat = "prop", position = position_fill(.5)) -p -p + facet_grid(~ Sex) +p_(p) +p_(p + facet_grid(~ Sex)) -ggplot(d) + +p_(ggplot(d) + aes(x = Class, fill = Survived, weight = Freq) + geom_bar(position = "dodge") + geom_text( aes(by = Survived), stat = "prop", position = position_dodge(0.9), vjust = "bottom" - ) + )) -ggplot(d) + +p_(ggplot(d) + aes(x = Class, fill = Survived, weight = Freq, by = 1) + geom_bar() + geom_text( aes(label = scales::percent(after_stat(prop), accuracy = 1)), stat = "prop", position = position_stack(.5) - ) - + )) } \seealso{ \code{\link[ggplot2]{stat_count}} diff --git a/man/stat_weighted_mean.Rd b/man/stat_weighted_mean.Rd index 32b810fd2..5ca6bc2b4 100644 --- a/man/stat_weighted_mean.Rd +++ b/man/stat_weighted_mean.Rd @@ -84,41 +84,44 @@ aesthetic if provided. } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive + data(tips, package = "reshape") -ggplot(tips) + +p_(ggplot(tips) + aes(x = day, y = total_bill) + - geom_point() + geom_point()) -ggplot(tips) + +p_(ggplot(tips) + aes(x = day, y = total_bill) + - stat_weighted_mean() + stat_weighted_mean()) -ggplot(tips) + +p_(ggplot(tips) + aes(x = day, y = total_bill, group = 1) + - stat_weighted_mean(geom = "line") + stat_weighted_mean(geom = "line")) -ggplot(tips) + +p_(ggplot(tips) + aes(x = day, y = total_bill, colour = sex, group = sex) + - stat_weighted_mean(geom = "line") + stat_weighted_mean(geom = "line")) -ggplot(tips) + +p_(ggplot(tips) + aes(x = day, y = total_bill, fill = sex) + - stat_weighted_mean(geom = "bar", position = "dodge") + stat_weighted_mean(geom = "bar", position = "dodge")) # computing a proportion on the fly -ggplot(tips) + +p_(ggplot(tips) + aes(x = day, y = as.integer(smoker == "Yes"), fill = sex) + stat_weighted_mean(geom = "bar", position = "dodge") + - scale_y_continuous(labels = scales::percent) + scale_y_continuous(labels = scales::percent)) # taking into account some weights d <- as.data.frame(Titanic) -ggplot(d) + +p_(ggplot(d) + aes(x = Class, y = as.integer(Survived == "Yes"), weight = Freq, fill = Sex) + geom_bar(stat = "weighted_mean", position = "dodge") + scale_y_continuous(labels = scales::percent) + - labs(y = "Survived") + labs(y = "Survived")) \dontrun{ diff --git a/man/v1_ggmatrix_theme.Rd b/man/v1_ggmatrix_theme.Rd index 8ae8693c8..87e8ed474 100644 --- a/man/v1_ggmatrix_theme.Rd +++ b/man/v1_ggmatrix_theme.Rd @@ -10,8 +10,10 @@ v1_ggmatrix_theme() Modify a \code{\link{ggmatrix}} object by adding an \pkg{ggplot2} object to all } \examples{ +# Small function to display plots only if it's interactive +p_ <- GGally::print_if_interactive -ggpairs(iris, 1:2) + v1_ggmatrix_theme() +p_(ggpairs(iris, 1:2) + v1_ggmatrix_theme()) # move the column names to the left and bottom -ggpairs(iris, 1:2, switch = "both") + v1_ggmatrix_theme() +p_(ggpairs(iris, 1:2, switch = "both") + v1_ggmatrix_theme()) } diff --git a/man/vig_ggally.Rd b/man/vig_ggally.Rd new file mode 100644 index 000000000..bae47dfed --- /dev/null +++ b/man/vig_ggally.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/vig_ggally.R +\name{vig_ggally} +\alias{vig_ggally} +\title{View \pkg{GGally} vignettes} +\usage{ +vig_ggally(name) +} +\arguments{ +\item{name}{Vignette name to open. If no name is provided, the vignette index will be opened} +} +\description{ +This function will open the directly to the vignette requested. If no \code{name} is provided, the index of all \pkg{GGally} vignettes will be opened. +} +\details{ +This method allows for vignettes to be hosted remotely, reducing \pkg{GGally}'s package size, and installation time. +} +\examples{ +\donttest{ +# View `ggnostic` vignette +vig_ggally("ggnostic") + +# View all vignettes by GGally +vig_ggally()} +} diff --git a/revdep/README.md b/revdep/README.md index 8039b7f87..06c0e8074 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -2,20 +2,124 @@ |field |value | |:--------|:----------------------------| -|version |R version 3.6.3 (2020-02-29) | -|os |macOS Catalina 10.15.3 | -|system |x86_64, darwin15.6.0 | +|version |R version 4.0.0 (2020-04-24) | +|os |macOS Catalina 10.15.5 | +|system |x86_64, darwin17.0 | |ui |X11 | |language |(EN) | |collate |en_US.UTF-8 | |ctype |en_US.UTF-8 | |tz |America/New_York | -|date |2020-03-19 | +|date |2020-06-05 | # Dependencies |package |old |new |Δ | |:-------|:-----|:-----|:--| -|GGally |1.4.0 |1.5.0 |* | +|GGally |1.5.0 |2.0.0 |* | # Revdeps + +## All (98) + +|package |version |error |warning |note | +|:----------------------------------------------|:-------|:-----|:-------|:----| +|[adventr](problems.md#adventr) |0.1.8 | | |2 | +|[alevinQC](problems.md#alevinqc) |1.4.0 | | |1 | +|[ALPS](problems.md#alps) |1.2.0 | | |1 | +|BAS |1.5.5 | | | | +|bayestestR |0.6.0 | | | | +|[BGGM](problems.md#bggm) |2.0.0 | | |2 | +|[bigPint](problems.md#bigpint) |1.4.0 | | |1 | +|brinton |0.1.7 | | | | +|CARBayes |5.2 | | | | +|CARBayesST |3.1 | | | | +|[CeTF](problems.md#cetf) |1.0.2 | | |1 | +|[CINNA](problems.md#cinna) |1.1.53 | | |1 | +|[CluMSID](problems.md#clumsid) |1.4.0 | | |2 | +|clustrd |1.3.7-2 | | | | +|[ctsem](problems.md#ctsem) |3.2.1 | | |3 | +|DescribeDisplay |0.2.7 | | | | +|discourseGT |1.0.0 | | | | +|eechidna |1.4.0 | | | | +|egoTERGM |2.1.1 | | | | +|EMMIXmfa |2.0.11 | | | | +|[fic](problems.md#fic) |1.0.0 | | |1 | +|[finalfit](problems.md#finalfit) |1.0.1 |1 | | | +|[fingerPro](problems.md#fingerpro) |1.1 | | |1 | +|fpp2 |2.3 | | | | +|freqparcoord |1.0.1 | | | | +|[GENESIS](problems.md#genesis) |2.18.0 | | |3 | +|[ggbio](problems.md#ggbio) |1.36.0 | |1 |2 | +|ggmcmc |1.4.1 | | | | +|[GGPA](problems.md#ggpa) |1.0.0 | | |2 | +|ggPMX |1.1.1 | | | | +|[ggquickeda](problems.md#ggquickeda) |0.1.6 | | |1 | +|glancedata |1.0.1 | | | | +|growthPheno |1.0-22 | | | | +|gsynth |1.0.9 | | | | +|HierDpart |0.5.0 | | | | +|[httk](problems.md#httk) |2.0.1 | | |1 | +|[ICtest](problems.md#ictest) |0.3-2 | | |1 | +|imageData |0.1-60 | | | | +|[isomiRs](problems.md#isomirs) |1.16.2 |1 | |3 | +|ITNr |0.6.0 | | | | +|[jmv](problems.md#jmv) |1.2.5 | | |1 | +|[jsmodule](problems.md#jsmodule) |1.0.8 | | |1 | +|[LANDD](problems.md#landd) |1.1.0 | | |1 | +|[MAINT.Data](problems.md#maintdata) |2.3.1 | | |1 | +|[MAST](problems.md#mast) |1.14.0 | | |2 | +|[MCbiclust](problems.md#mcbiclust) |1.12.0 | | |1 | +|metan |1.6.0 | | | | +|[mgcViz](problems.md#mgcviz) |0.1.6 | | |1 | +|[MissingDataGUI](problems.md#missingdatagui) |0.2-5 | |4 |4 | +|mitch |1.0.4 | | | | +|miWQS |0.2.0 | | | | +|mlergm |0.5 | | | | +|mlr3viz |0.1.1 | | | | +|[mlrMBO](problems.md#mlrmbo) |1.1.4 | | |1 | +|[MOFA](problems.md#mofa) |1.4.0 |1 | |5 | +|MRPC |2.2.0 | | | | +|[NetworkChange](problems.md#networkchange) |0.6 | | |1 | +|[nzelect](problems.md#nzelect) |0.4.0 | | |2 | +|[ORFik](problems.md#orfik) |1.8.1 | | |2 | +|OutliersO3 |0.6.3 | | | | +|[PAFway](problems.md#pafway) |0.1.3 | | |1 | +|ParamHelpers |1.14 | | | | +|Pi |2.0.0 | | | | +|[plotly](problems.md#plotly) |4.9.2.1 | | |1 | +|[PopGenReport](problems.md#popgenreport) |3.0.4 | | |1 | +|PPforest |0.1.1 | | | | +|[pubh](problems.md#pubh) |1.1.14 | | |1 | +|qualvar |0.2.0 | | | | +|QuantNorm |1.0.5 | | | | +|randomForestExplainer |0.10.0 | | | | +|RHMS |1.6 | | | | +|[robCompositions](problems.md#robcompositions) |2.2.1 | | |1 | +|[robustbase](problems.md#robustbase) |0.93-6 | | |1 | +|robustSingleCell |0.1.1 | | | | +|[rrr](problems.md#rrr) |1.0.0 | | |1 | +|rwty |1.0.2 | | | | +|[scPipe](problems.md#scpipe) |1.10.0 | | |4 | +|[SeqSQC](problems.md#seqsqc) |1.10.0 | | |1 | +|SHELF |1.7.0 | | | | +|SimBIID |0.2.0 | | | | +|simplexdesign |0.1.0 | | | | +|[SmartEDA](problems.md#smarteda) |0.3.5 | | |1 | +|[spinifex](problems.md#spinifex) |0.1.0 | | |1 | +|[spup](problems.md#spup) |1.3-2 | | |1 | +|staRdom |1.1.11 | | | | +|[statVisual](problems.md#statvisual) |1.2.1 | | |1 | +|[tidybulk](problems.md#tidybulk) |1.0.0 |2 | |3 | +|TNBC.CMS |1.4.0 | | | | +|tsfeatures |1.0.1 | | | | +|[TVTB](problems.md#tvtb) |1.14.0 | | |1 | +|[ubiquity](problems.md#ubiquity) |1.0.1 | | |1 | +|[ufs](problems.md#ufs) |0.3.1 | | |2 | +|userfriendlyscience |0.7.2 | | | | +|ushr |0.2.3 | | | | +|[vidger](problems.md#vidger) |1.8.0 | | |1 | +|vortexR |1.1.7 | | | | +|WRS2 |1.0-0 | | | | +|WRSS |3.0 | | | | + diff --git a/revdep/problems.md b/revdep/problems.md index 9a2073633..27dbc1f6e 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -1 +1,1592 @@ -*Wow, no problems at all. :)* \ No newline at end of file +# adventr + +
+ +* Version: 0.1.8 +* Source code: https://github.com/cran/adventr +* Date/Publication: 2020-05-05 16:50:06 UTC +* Number of recursive dependencies: 162 + +Run `revdep_details(,"adventr")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.7Mb + sub-directories of 1Mb or more: + tutorials 5.5Mb + ``` + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘BayesFactor’ ‘GGally’ ‘Hmisc’ ‘WRS2’ ‘boot’ ‘car’ ‘dplyr’ ‘effects’ + ‘effsize’ ‘forcats’ ‘ggplot2’ ‘lm.beta’ ‘nlme’ ‘readr’ ‘robust’ + ‘sandwich’ ‘sjstats’ ‘tidyr’ + All declared Imports should be used. + ``` + +# alevinQC + +
+ +* Version: 1.4.0 +* Source code: https://github.com/cran/alevinQC +* URL: https://github.com/csoneson/alevinQC +* BugReports: https://github.com/csoneson/alevinQC/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 87 + +Run `revdep_details(,"alevinQC")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 12.7Mb + sub-directories of 1Mb or more: + extdata 11.6Mb + ``` + +# ALPS + +
+ +* Version: 1.2.0 +* Source code: https://github.com/cran/ALPS +* URL: https://github.com/itsvenu/ALPS +* BugReports: https://github.com/itsvenu/ALPS/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 194 + +Run `revdep_details(,"ALPS")` for more info + +
+ +## In both + +* checking for hidden files and directories ... NOTE + ``` + Found the following hidden files and directories: + .BBSoptions + These were most likely included in error. See section ‘Package + structure’ in the ‘Writing R Extensions’ manual. + ``` + +# BGGM + +
+ +* Version: 2.0.0 +* Source code: https://github.com/cran/BGGM +* BugReports: https://github.com/donaldRwilliams/BGGM/issues +* Date/Publication: 2020-05-31 21:10:09 UTC +* Number of recursive dependencies: 185 + +Run `revdep_details(,"BGGM")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.1Mb + sub-directories of 1Mb or more: + doc 2.6Mb + ``` + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘RcppProgress’ + All declared Imports should be used. + ``` + +# bigPint + +
+ +* Version: 1.4.0 +* Source code: https://github.com/cran/bigPint +* URL: https://github.com/lindsayrutter/bigPint +* BugReports: https://github.com/lindsayrutter/bigPint/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 165 + +Run `revdep_details(,"bigPint")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 8.1Mb + sub-directories of 1Mb or more: + data 2.1Mb + doc 2.7Mb + shiny-examples 3.0Mb + ``` + +# CeTF + +
+ +* Version: 1.0.2 +* Source code: https://github.com/cran/CeTF +* Date/Publication: 2020-05-31 +* Number of recursive dependencies: 224 + +Run `revdep_details(,"CeTF")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.2Mb + sub-directories of 1Mb or more: + data 1.6Mb + doc 3.0Mb + ``` + +# CINNA + +
+ +* Version: 1.1.53 +* Source code: https://github.com/cran/CINNA +* Date/Publication: 2019-02-25 12:50:14 UTC +* Number of recursive dependencies: 136 + +Run `revdep_details(,"CINNA")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘circlize’ + All declared Imports should be used. + ``` + +# CluMSID + +
+ +* Version: 1.4.0 +* Source code: https://github.com/cran/CluMSID +* URL: https://github.com/tdepke/CluMSID +* BugReports: https://github.com/tdepke/CluMSID/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 164 + +Run `revdep_details(,"CluMSID")` for more info + +
+ +## In both + +* checking package dependencies ... NOTE + ``` + Package suggested but not available for checking: ‘xcms’ + ``` + +* checking installed package size ... NOTE + ``` + installed size is 6.2Mb + sub-directories of 1Mb or more: + doc 5.6Mb + ``` + +# ctsem + +
+ +* Version: 3.2.1 +* Source code: https://github.com/cran/ctsem +* URL: https://github.com/cdriveraus/ctsem +* Date/Publication: 2020-04-26 01:00:07 UTC +* Number of recursive dependencies: 128 + +Run `revdep_details(,"ctsem")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 9.6Mb + sub-directories of 1Mb or more: + R 2.0Mb + libs 6.3Mb + ``` + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘numDeriv’ ‘pkgbuild’ + All declared Imports should be used. + ``` + +* checking for GNU extensions in Makefiles ... NOTE + ``` + GNU make is a SystemRequirements. + ``` + +# fic + +
+ +* Version: 1.0.0 +* Source code: https://github.com/cran/fic +* URL: https://github.com/chjackson/fic +* BugReports: https://github.com/chjackson/fic/issues +* Date/Publication: 2019-04-13 08:32:39 UTC +* Number of recursive dependencies: 88 + +Run `revdep_details(,"fic")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘numDeriv’ + All declared Imports should be used. + ``` + +# finalfit + +
+ +* Version: 1.0.1 +* Source code: https://github.com/cran/finalfit +* URL: https://github.com/ewenharrison/finalfit +* BugReports: https://github.com/ewenharrison/finalfit/issues +* Date/Publication: 2020-04-21 11:50:02 UTC +* Number of recursive dependencies: 134 + +Run `revdep_details(,"finalfit")` for more info + +
+ +## In both + +* checking examples ... ERROR + ``` + ... + mort_5yr mort_5yr.num n + 1 Alive 1 511 + 2 Died 2 404 + 3 NA 14 + + $counts[[19]] + sex.factor2 age.factor2 n + 1 M <60 years 204 + 2 M 60+ years 241 + 3 F <60 years 210 + 4 F 60+ years 274 + + + > + > # Select a tibble and expand + > out$counts[[9]] %>% + + print(n = Inf) + Error in print.default(m, ..., quote = quote, right = right, max = max) : + invalid 'na.print' specification + Calls: %>% ... print -> print.data.frame -> print -> print.default + Execution halted + ``` + +# fingerPro + +
+ +* Version: 1.1 +* Source code: https://github.com/cran/fingerPro +* URL: https://github.com/eead-csic-eesa +* Date/Publication: 2018-08-28 10:04:54 UTC +* Number of recursive dependencies: 154 + +Run `revdep_details(,"fingerPro")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘RcppProgress’ + All declared Imports should be used. + ``` + +# GENESIS + +
+ +* Version: 2.18.0 +* Source code: https://github.com/cran/GENESIS +* URL: https://github.com/UW-GAC/GENESIS +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 150 + +Run `revdep_details(,"GENESIS")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 6.9Mb + sub-directories of 1Mb or more: + doc 3.2Mb + extdata 3.1Mb + ``` + +* checking dependencies in R code ... NOTE + ``` + ':::' calls which should be '::': + ‘SPAtest:::Saddle_Prob’ ‘SPAtest:::Saddle_Prob_fast’ + See the note in ?`:::` about the use of this operator. + Unexported object imported by a ':::' call: ‘survey:::saddle’ + See the note in ?`:::` about the use of this operator. + ``` + +* checking R code for possible problems ... NOTE + ``` + .pcrelate: no visible binding for global variable ‘k’ + calcISAFBeta: no visible binding for global variable ‘k’ + pcrelateSampBlock: no visible binding for global variable ‘k’ + Undefined global functions or variables: + k + ``` + +# ggbio + +
+ +* Version: 1.36.0 +* Source code: https://github.com/cran/ggbio +* URL: http://tengfei.github.com/ggbio/ +* BugReports: https://github.com/tengfei/ggbio/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 157 + +Run `revdep_details(,"ggbio")` for more info + +
+ +## In both + +* checking examples ... WARNING + ``` + Found the following significant warnings: + + Warning: 'GenenameFilter' is deprecated. + Deprecated functions may be defunct as soon as of the next release of + R. + See ?Deprecated. + ``` + +* checking dependencies in R code ... NOTE + ``` + ':::' call which should be '::': 'ggplot2:::set_last_plot' + See the note in ?`:::` about the use of this operator. + Unexported objects imported by ':::' calls: + 'S4Vectors:::top_prenv' 'ggplot2:::add_ggplot' 'ggplot2:::cunion' + 'ggplot2:::rename_aes' 'ggplot2:::rescale01' + See the note in ?`:::` about the use of this operator. + ``` + +* checking R code for possible problems ... NOTE + ``` + ... + layout_karyogram,GRanges: no visible binding for global variable 'xend' + layout_karyogram,GRanges: no visible binding for global variable 'yend' + layout_karyogram,GRanges: no visible binding for global variable 'y2' + layout_karyogram,GRanges: no visible binding for global variable + 'yend2' + layout_karyogram,GRanges: no visible binding for global variable 'name' + plotFragLength,character-GRanges: no visible binding for global + variable '.fragLength' + plotSpliceSum,character-EnsDb: possible error in GRangesFilter(which, + condition = "overlapping"): unused argument (condition = + "overlapping") + stat_mismatch,GRanges: no visible binding for global variable 'sts' + stat_mismatch,GRanges: no visible binding for global variable 'eds' + stat_mismatch,GRanges: no visible binding for global variable 'read' + Undefined global functions or variables: + .fragLength .layout_circle.stats .x breaks coefs data eds fe fl + gieStain ideoCyto indexProbesProcessed midpoint mt name read se + stepping sts value variable x xend y y.text y2 yend yend2 + Consider adding + importFrom("utils", "data") + to your NAMESPACE file. + ``` + +# GGPA + +
+ +* Version: 1.0.0 +* Source code: https://github.com/cran/GGPA +* URL: https://github.com/dongjunchung/GGPA/ +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 73 + +Run `revdep_details(,"GGPA")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Packages in Depends field not imported from: + ‘network’ ‘scales’ ‘sna’ + These packages need to be imported from (in the NAMESPACE file) + for when this namespace is loaded but not attached. + ``` + +* checking compiled code ... NOTE + ``` + File ‘GGPA/libs/GGPA.so’: + Found ‘__ZNSt3__14coutE’, possibly from ‘std::cout’ (C++) + Object: ‘3_Param.o’ + + Compiled code should not call entry points which might terminate R nor + write to stdout/stderr instead of to the console, nor use Fortran I/O + nor system RNGs. + + See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual. + ``` + +# ggquickeda + +
+ +* Version: 0.1.6 +* Source code: https://github.com/cran/ggquickeda +* URL: https://github.com/smouksassi/ggquickeda +* BugReports: https://github.com/smouksassi/ggquickeda/issues +* Date/Publication: 2020-04-17 14:00:03 UTC +* Number of recursive dependencies: 157 + +Run `revdep_details(,"ggquickeda")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘DT’ ‘Formula’ ‘GGally’ ‘Hmisc’ ‘colourpicker’ ‘dplyr’ ‘ggpmisc’ + ‘ggpubr’ ‘ggrepel’ ‘ggstance’ ‘grDevices’ ‘grid’ ‘gridExtra’ + ‘lazyeval’ ‘markdown’ ‘plotly’ ‘quantreg’ ‘rlang’ ‘shinyjqui’ + ‘shinyjs’ ‘survival’ ‘survminer’ ‘table1’ ‘tidyr’ + All declared Imports should be used. + ``` + +# httk + +
+ +* Version: 2.0.1 +* Source code: https://github.com/cran/httk +* URL: https://www.epa.gov/chemical-research/rapid-chemical-exposure-and-dose-research +* BugReports: https://github.com/USEPA/CompTox-ExpoCast-httk +* Date/Publication: 2020-03-02 06:00:12 UTC +* Number of recursive dependencies: 111 + +Run `revdep_details(,"httk")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 12.7Mb + sub-directories of 1Mb or more: + data 9.1Mb + doc 2.1Mb + ``` + +# ICtest + +
+ +* Version: 0.3-2 +* Source code: https://github.com/cran/ICtest +* Date/Publication: 2019-08-23 11:50:02 UTC +* Number of recursive dependencies: 80 + +Run `revdep_details(,"ICtest")` for more info + +
+ +## In both + +* checking Rd cross-references ... NOTE + ``` + Package unavailable to check Rd xrefs: ‘fICA’ + ``` + +# isomiRs + +
+ +* Version: 1.16.2 +* Source code: https://github.com/cran/isomiRs +* BugReports: https://github.com/lpantano/isomiRs/issues +* Date/Publication: 2020-06-03 +* Number of recursive dependencies: 149 + +Run `revdep_details(,"isomiRs")` for more info + +
+ +## In both + +* checking examples ... ERROR + ``` + Running examples in ‘isomiRs-Ex.R’ failed + The error most likely occurred in: + + > ### Name: mirna2targetscan + > ### Title: Find targets in targetscan database + > ### Aliases: mirna2targetscan + > + > ### ** Examples + > + > library(targetscan.Hs.eg.db) + Error in library(targetscan.Hs.eg.db) : + there is no package called ‘targetscan.Hs.eg.db’ + Execution halted + ``` + +* checking package dependencies ... NOTE + ``` + Package suggested but not available for checking: ‘targetscan.Hs.eg.db’ + ``` + +* checking for hidden files and directories ... NOTE + ``` + Found the following hidden files and directories: + .travis.yml + These were most likely included in error. See section ‘Package + structure’ in the ‘Writing R Extensions’ manual. + ``` + +* checking R code for possible problems ... NOTE + ``` + ... + ‘targetscan.Hs.egMIRNA’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Hs.egMIRBASE2FAMILY’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Hs.egTARGETS’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Hs.egTARGETSFULL’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Mm.egMIRNA’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Mm.egMIRBASE2FAMILY’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Mm.egTARGETS’ + mirna2targetscan: no visible binding for global variable + ‘targetscan.Mm.egTARGETSFULL’ + Undefined global functions or variables: + as.tibble changes hits iso_sample pct targetscan.Hs.egMIRBASE2FAMILY + targetscan.Hs.egMIRNA targetscan.Hs.egTARGETS + targetscan.Hs.egTARGETSFULL targetscan.Mm.egMIRBASE2FAMILY + targetscan.Mm.egMIRNA targetscan.Mm.egTARGETS + targetscan.Mm.egTARGETSFULL total + ``` + +# jmv + +
+ +* Version: 1.2.5 +* Source code: https://github.com/cran/jmv +* Date/Publication: 2020-02-17 16:40:14 UTC +* Number of recursive dependencies: 193 + +Run `revdep_details(,"jmv")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘BayesFactor’ ‘GGally’ ‘GPArotation’ ‘MASS’ ‘PMCMR’ ‘R6’ ‘ROCR’ + ‘afex’ ‘car’ ‘emmeans’ ‘ggridges’ ‘lavaan’ ‘multcomp’ ‘mvnormtest’ + ‘nnet’ ‘psych’ ‘vcd’ ‘vcdExtra’ + All declared Imports should be used. + ``` + +# jsmodule + +
+ +* Version: 1.0.8 +* Source code: https://github.com/cran/jsmodule +* URL: https://github.com/jinseob2kim/jsmodule +* BugReports: https://github.com/jinseob2kim/jsmodule/issues +* Date/Publication: 2020-06-04 17:00:02 UTC +* Number of recursive dependencies: 188 + +Run `revdep_details(,"jsmodule")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘Cairo’ ‘survC1’ + All declared Imports should be used. + ``` + +# LANDD + +
+ +* Version: 1.1.0 +* Source code: https://github.com/cran/LANDD +* Date/Publication: 2016-10-01 01:14:24 +* Number of recursive dependencies: 103 + +Run `revdep_details(,"LANDD")` for more info + +
+ +## In both + +* checking R code for possible problems ... NOTE + ``` + getGO: no visible global function definition for ‘new’ + getGO: no visible global function definition for ‘getGeneric’ + graph.kd: no visible global function definition for ‘as’ + Undefined global functions or variables: + as getGeneric new + Consider adding + importFrom("methods", "as", "getGeneric", "new") + to your NAMESPACE file (and ensure that your DESCRIPTION Imports field + contains 'methods'). + ``` + +# MAINT.Data + +
+ +* Version: 2.3.1 +* Source code: https://github.com/cran/MAINT.Data +* Date/Publication: 2020-01-07 11:10:03 UTC +* Number of recursive dependencies: 66 + +Run `revdep_details(,"MAINT.Data")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 6.1Mb + sub-directories of 1Mb or more: + R 2.0Mb + libs 3.7Mb + ``` + +# MAST + +
+ +* Version: 1.14.0 +* Source code: https://github.com/cran/MAST +* URL: https://github.com/RGLab/MAST/ +* BugReports: https://github.com/RGLab/MAST/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 194 + +Run `revdep_details(,"MAST")` for more info + +
+ +## In both + +* checking for hidden files and directories ... NOTE + ``` + Found the following hidden files and directories: + .travis.yml + These were most likely included in error. See section ‘Package + structure’ in the ‘Writing R Extensions’ manual. + ``` + +* checking installed package size ... NOTE + ``` + installed size is 10.5Mb + sub-directories of 1Mb or more: + data 4.1Mb + doc 5.2Mb + ``` + +# MCbiclust + +
+ +* Version: 1.12.0 +* Source code: https://github.com/cran/MCbiclust +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 177 + +Run `revdep_details(,"MCbiclust")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 9.6Mb + sub-directories of 1Mb or more: + data 3.1Mb + doc 5.5Mb + ``` + +# mgcViz + +
+ +* Version: 0.1.6 +* Source code: https://github.com/cran/mgcViz +* URL: https://github.com/mfasiolo/mgcViz +* BugReports: https://github.com/mfasiolo/mgcViz/issues +* Date/Publication: 2020-03-04 15:10:02 UTC +* Number of recursive dependencies: 95 + +Run `revdep_details(,"mgcViz")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.1Mb + sub-directories of 1Mb or more: + doc 4.4Mb + ``` + +# MissingDataGUI + +
+ +* Version: 0.2-5 +* Source code: https://github.com/cran/MissingDataGUI +* Date/Publication: 2016-04-25 08:58:53 +* Number of recursive dependencies: 102 + +Run `revdep_details(,"MissingDataGUI")` for more info + +
+ +## In both + +* checking S3 generic/method consistency ... WARNING + ``` + + (R:34676): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + See section ‘Generic functions and methods’ in the ‘Writing R + Extensions’ manual. + ``` + +* checking replacement functions ... WARNING + ``` + + (R:34834): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + The argument of a replacement function which corresponds to the right + hand side must be named ‘value’. + ``` + +* checking for missing documentation entries ... WARNING + ``` + + (R:35294): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + All user-level objects in a package should have documentation entries. + See chapter ‘Writing R documentation files’ in the ‘Writing R + Extensions’ manual. + ``` + +* checking for code/documentation mismatches ... WARNING + ``` + + (R:35454): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + + (R:35517): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + + (R:35576): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + ``` + +* checking dependencies in R code ... NOTE + ``` + + (R:34374): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + ``` + +* checking foreign function calls ... NOTE + ``` + + (R:34960): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + See chapter ‘System and foreign language interfaces’ in the ‘Writing R + Extensions’ manual. + ``` + +* checking R code for possible problems ... NOTE + ``` + + (R:35057): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + ``` + +* checking Rd \usage sections ... NOTE + ``` + + (R:35671): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init() + The \usage entries for S3 methods should use the \method markup and not + their full name. + See chapter ‘Writing R documentation files’ in the ‘Writing R + Extensions’ manual. + ``` + +# mlrMBO + +
+ +* Version: 1.1.4 +* Source code: https://github.com/cran/mlrMBO +* URL: https://github.com/mlr-org/mlrMBO +* BugReports: https://github.com/mlr-org/mlrMBO/issues +* Date/Publication: 2020-02-28 21:20:03 UTC +* Number of recursive dependencies: 131 + +Run `revdep_details(,"mlrMBO")` for more info + +
+ +## In both + +* checking package dependencies ... NOTE + ``` + Package suggested but not available for checking: ‘DiceOptim’ + ``` + +# MOFA + +
+ +* Version: 1.4.0 +* Source code: https://github.com/cran/MOFA +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 97 + +Run `revdep_details(,"MOFA")` for more info + +
+ +## In both + +* checking examples ... ERROR + ``` + Running examples in ‘MOFA-Ex.R’ failed + The error most likely occurred in: + + > ### Name: DataOptions + > ### Title: DataOptions: set and retrieve data options + > ### Aliases: DataOptions DataOptions<- DataOptions,MOFAmodel-method + > ### DataOptions<-,MOFAmodel,list-method + > + > ### ** Examples + > + > # load a trained MOFAmodel object + > filepath <- system.file("extdata", "scMT_model.hdf5", package = "MOFAdata") + > MOFAobject <- loadModel(filepath) + Error in h5checktypeOrOpenLoc(file, readonly = TRUE, native = native) : + Error in h5checktypeOrOpenLoc(). Cannot open file. File '' does not exist. + Calls: loadModel -> h5read -> h5checktypeOrOpenLoc + Execution halted + ``` + +* checking package dependencies ... NOTE + ``` + Package suggested but not available for checking: ‘MOFAdata’ + ``` + +* checking for hidden files and directories ... NOTE + ``` + Found the following hidden files and directories: + .BBSoptions + These were most likely included in error. See section ‘Package + structure’ in the ‘Writing R Extensions’ manual. + ``` + +* checking installed package size ... NOTE + ``` + installed size is 5.3Mb + sub-directories of 1Mb or more: + doc 4.6Mb + ``` + +* checking R code for possible problems ... NOTE + ``` + plotEnrichmentDetailed: no visible binding for global variable + ‘pathway’ + plotEnrichmentDetailed: no visible binding for global variable + ‘feature.statistic’ + Undefined global functions or variables: + feature.statistic pathway + ``` + +* checking Rd cross-references ... NOTE + ``` + Package unavailable to check Rd xrefs: ‘PCGSE’ + ``` + +# NetworkChange + +
+ +* Version: 0.6 +* Source code: https://github.com/cran/NetworkChange +* Date/Publication: 2020-02-06 05:20:02 UTC +* Number of recursive dependencies: 135 + +Run `revdep_details(,"NetworkChange")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘sna’ + All declared Imports should be used. + ``` + +# nzelect + +
+ +* Version: 0.4.0 +* Source code: https://github.com/cran/nzelect +* Date/Publication: 2017-10-02 20:35:23 UTC +* Number of recursive dependencies: 73 + +Run `revdep_details(,"nzelect")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.3Mb + sub-directories of 1Mb or more: + data 5.0Mb + ``` + +* checking data for non-ASCII characters ... NOTE + ``` + Note: found 6409 marked UTF-8 strings + ``` + +# ORFik + +
+ +* Version: 1.8.1 +* Source code: https://github.com/cran/ORFik +* URL: https://github.com/Roleren/ORFik +* BugReports: https://github.com/Roleren/ORFik/issues +* Date/Publication: 2020-04-29 +* Number of recursive dependencies: 128 + +Run `revdep_details(,"ORFik")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Unexported objects imported by ':::' calls: + ‘GenomicFeatures:::.merge_seqinfo_and_infer_missing_seqlengths’ + ‘IRanges:::regroupBySupergroup’ + See the note in ?`:::` about the use of this operator. + ``` + +* checking R code for possible problems ... NOTE + ``` + ... + windowCoveragePlot: no visible binding for global variable + ‘fraction_min’ + windowCoveragePlot: no visible binding for global variable ‘position’ + Undefined global functions or variables: + . CDS CDSGrouping Hx LEADERS ORFGrouping ORFScores RRS RSS + StartCodons StopCodons TOP View chr codonSums count countRFP + count_seq_pos_with_count dif difPer disengagementScores distORFCDS + entropyRFP exon_rank feature forward fpkmRFP fpkmRNA fraction + fraction.x fraction.y fractionLengths fraction_min fractions frame + frame_one_RP frame_two_RP gene_sum grnames inFrameCDS ioScore + isOverlappingCds kozak leaders mRNA median_score offsets_start ones + position rankInTx ranks ratio_cds_leader ratio_cds_mrna + ratio_mrna_aligned read.csv2 read.table rowSums2 scalingFactor seq1 + seq2 seq3 seq4 seq5 size startCodonCoverage startRegionRelative te + trailers tx utr3_len utr5_len value variable widths windowMean + windowSD write.csv write.table zscore + Consider adding + importFrom("graphics", "frame") + importFrom("utils", "View", "read.csv2", "read.table", "write.csv", + "write.table") + to your NAMESPACE file. + ``` + +# PAFway + +
+ +* Version: 0.1.3 +* Source code: https://github.com/cran/PAFway +* Date/Publication: 2020-02-05 16:40:02 UTC +* Number of recursive dependencies: 75 + +Run `revdep_details(,"PAFway")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘network’ ‘scales’ ‘sna’ + All declared Imports should be used. + ``` + +# plotly + +
+ +* Version: 4.9.2.1 +* Source code: https://github.com/cran/plotly +* URL: https://plotly-r.com, https://github.com/ropensci/plotly#readme, https://plot.ly/r +* BugReports: https://github.com/ropensci/plotly/issues +* Date/Publication: 2020-04-04 19:50:02 UTC +* Number of recursive dependencies: 150 + +Run `revdep_details(,"plotly")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 6.6Mb + sub-directories of 1Mb or more: + htmlwidgets 3.7Mb + ``` + +# PopGenReport + +
+ +* Version: 3.0.4 +* Source code: https://github.com/cran/PopGenReport +* URL: https://github.com/green-striped-gecko/PopGenReport +* Date/Publication: 2019-02-04 12:13:23 UTC +* Number of recursive dependencies: 119 + +Run `revdep_details(,"PopGenReport")` for more info + +
+ +## In both + +* checking Rd cross-references ... NOTE + ``` + Package unavailable to check Rd xrefs: ‘ecodist’ + ``` + +# pubh + +
+ +* Version: 1.1.14 +* Source code: https://github.com/cran/pubh +* URL: https://github.com/josie-athens/pubh +* BugReports: https://github.com/josie-athens/pubh/issues +* Date/Publication: 2020-06-02 06:50:02 UTC +* Number of recursive dependencies: 203 + +Run `revdep_details(,"pubh")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘Hmisc’ + All declared Imports should be used. + ``` + +# robCompositions + +
+ +* Version: 2.2.1 +* Source code: https://github.com/cran/robCompositions +* Date/Publication: 2020-02-11 17:20:02 UTC +* Number of recursive dependencies: 123 + +Run `revdep_details(,"robCompositions")` for more info + +
+ +## In both + +* checking Rd cross-references ... NOTE + ``` + Packages unavailable to check Rd xrefs: ‘mvoutlier’, ‘StatDA’ + ``` + +# robustbase + +
+ +* Version: 0.93-6 +* Source code: https://github.com/cran/robustbase +* URL: http://robustbase.r-forge.r-project.org/ +* Date/Publication: 2020-03-23 17:40:02 UTC +* Number of recursive dependencies: 72 + +Run `revdep_details(,"robustbase")` for more info + +
+ +## In both + +* checking Rd cross-references ... NOTE + ``` + Package unavailable to check Rd xrefs: ‘robustX’ + ``` + +# rrr + +
+ +* Version: 1.0.0 +* Source code: https://github.com/cran/rrr +* URL: http://github.com/chrisaddy/rrr +* Date/Publication: 2016-12-09 15:15:55 +* Number of recursive dependencies: 85 + +Run `revdep_details(,"rrr")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘Rcpp’ + All declared Imports should be used. + ``` + +# scPipe + +
+ +* Version: 1.10.0 +* Source code: https://github.com/cran/scPipe +* URL: https://github.com/LuyiTian/scPipe +* BugReports: https://github.com/LuyiTian/scPipe +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 137 + +Run `revdep_details(,"scPipe")` for more info + +
+ +## In both + +* checking for hidden files and directories ... NOTE + ``` + Found the following hidden files and directories: + .BBSoptions + These were most likely included in error. See section ‘Package + structure’ in the ‘Writing R Extensions’ manual. + ``` + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘scater’ + All declared Imports should be used. + ``` + +* checking R code for possible problems ... NOTE + ``` + anno_to_saf: no visible binding for global variable ‘GeneID’ + convert_geneid: no visible global function definition for ‘useMart’ + get_genes_by_GO: no visible global function definition for ‘useMart’ + infer_gene_id_from_parent: no visible binding for global variable + ‘type’ + plot_demultiplex: no visible binding for global variable ‘status’ + plot_demultiplex: no visible binding for global variable ‘count’ + plot_demultiplex: no visible binding for global variable ‘label_y’ + plot_demultiplex: no visible binding for global variable ‘label_tx’ + Undefined global functions or variables: + GeneID count label_tx label_y status type useMart + ``` + +* checking for GNU extensions in Makefiles ... NOTE + ``` + GNU make is a SystemRequirements. + ``` + +# SeqSQC + +
+ +* Version: 1.10.0 +* Source code: https://github.com/cran/SeqSQC +* URL: https://github.com/Liubuntu/SeqSQC +* BugReports: https://github.com/Liubuntu/SeqSQC/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 125 + +Run `revdep_details(,"SeqSQC")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.7Mb + sub-directories of 1Mb or more: + doc 1.9Mb + extdata 3.3Mb + ``` + +# SmartEDA + +
+ +* Version: 0.3.5 +* Source code: https://github.com/cran/SmartEDA +* URL: https://daya6489.github.io/SmartEDA/ +* BugReports: https://github.com/daya6489/SmartEDA/issues +* Date/Publication: 2020-04-25 06:20:02 UTC +* Number of recursive dependencies: 112 + +Run `revdep_details(,"SmartEDA")` for more info + +
+ +## In both + +* checking Rd cross-references ... NOTE + ``` + Packages unavailable to check Rd xrefs: ‘InformationValue’, ‘DataExplorer’ + ``` + +# spinifex + +
+ +* Version: 0.1.0 +* Source code: https://github.com/cran/spinifex +* URL: https://github.com/nspyrison/spinifex/ +* BugReports: https://github.com/nspyrison/spinifex/issues +* Date/Publication: 2019-04-09 12:00:04 UTC +* Number of recursive dependencies: 89 + +Run `revdep_details(,"spinifex")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘GGally’ ‘tibble’ ‘webshot’ + All declared Imports should be used. + ``` + +# spup + +
+ +* Version: 1.3-2 +* Source code: https://github.com/cran/spup +* Date/Publication: 2020-04-30 22:20:06 UTC +* Number of recursive dependencies: 78 + +Run `revdep_details(,"spup")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘sp’ + All declared Imports should be used. + ``` + +# statVisual + +
+ +* Version: 1.2.1 +* Source code: https://github.com/cran/statVisual +* Date/Publication: 2020-02-20 19:30:02 UTC +* Number of recursive dependencies: 161 + +Run `revdep_details(,"statVisual")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘gbm’ ‘ggfortify’ ‘tibble’ ‘tidyverse’ + All declared Imports should be used. + ``` + +# tidybulk + +
+ +* Version: 1.0.0 +* Source code: https://github.com/cran/tidybulk +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 245 + +Run `revdep_details(,"tidybulk")` for more info + +
+ +## In both + +* checking examples ... ERROR + ``` + ... + ℹ Input `n` is `n()`. + ℹ The error occured in group 1: vs = 0, am = 0. + Backtrace: + █ + 1. └─by_vs_am %>% summarise(n = n()) + 2. ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) + 3. └─base::eval(quote(`_fseq`(`_lhs`)), env, env) + 4. └─base::eval(quote(`_fseq`(`_lhs`)), env, env) + 5. └─`_fseq`(`_lhs`) + 6. └─magrittr::freduce(value, `_function_list`) + 7. ├─base::withVisible(function_list[[k]](value)) + 8. └─function_list[[k]](value) + 9. ├─tidybulk::summarise(., n = n()) + 10. └─tidybulk:::summarise.default(., n = n()) + 11. ├─dplyr::summarise(.data, ...) + 12. └─dplyr:::summarise.grouped_df(.data, ...) + 13. └─dplyr:::summarise_cols(.data, ...) + + Backtrace: + █ + Execution halted + ``` + +* checking tests ... + ``` + ERROR + Running the tests in ‘tests/testthat.R’ failed. + Last 13 lines of output: + `Fraction of variance` PC + + 1 0.990 1 + 2 0.00310 2 + Getting the 100 most variable genes + Getting the 5 most variable genes + Getting the 5 most variable genes + ══ testthat results ═══════════════════════════════════════════════════════════ + [ OK: 139 | SKIPPED: 0 | WARNINGS: 18 | FAILED: 3 ] + 1. Error: Only scaled counts - no object (@test-bulk_methods.R#65) + 2. Error: tidybulk SummarizedExperiment normalisation manual (@test-bulk_methods_SummarizedExperiment.R#29) + 3. Error: tidybulk SummarizedExperiment normalisation (@test-bulk_methods_SummarizedExperiment.R#50) + + Error: testthat unit tests failed + Execution halted + ``` + +* checking installed package size ... NOTE + ``` + installed size is 8.4Mb + sub-directories of 1Mb or more: + data 7.1Mb + ``` + +* checking dependencies in R code ... NOTE + ``` + Missing object imported by a ':::' call: ‘dplyr:::flatten_bindable’ + package 'methods' is used but not declared + ``` + +* checking R code for possible problems ... NOTE + ``` + ... + tidybulk,RangedSummarizedExperiment: no visible binding for global + variable ‘.’ + tidybulk,RangedSummarizedExperiment: no visible binding for global + variable ‘feature’ + tidybulk,SummarizedExperiment: no visible binding for global variable + ‘.’ + tidybulk,SummarizedExperiment: no visible binding for global variable + ‘feature’ + Undefined global functions or variables: + (Intercept) . .a .abundance_scaled GeneID Status X_cibersort Y assay + buildIdx cluster cluster kmeans cmdscale.out correlation counts + data_base egsea egsea.base ensembl_id entrez + error_if_parameters_not_match feature genes item1 lowly_abundant m + med med.rank multiplier my_n n_aggr name pathway rc read count + ref_genome rotated dimensions rotation sample 1 sample 2 sample a + sample b sample_idx samples sdev seurat_clusters temp tot tot_filt + transcript tt_columns value variable x + Consider adding + importFrom("base", "sample") + importFrom("stats", "kmeans") + to your NAMESPACE file. + ``` + +# TVTB + +
+ +* Version: 1.14.0 +* Source code: https://github.com/cran/TVTB +* URL: https://github.com/kevinrue/TVTB +* BugReports: https://github.com/kevinrue/TVTB/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 158 + +Run `revdep_details(,"TVTB")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 5.6Mb + sub-directories of 1Mb or more: + R 2.0Mb + doc 2.7Mb + ``` + +# ubiquity + +
+ +* Version: 1.0.1 +* Source code: https://github.com/cran/ubiquity +* URL: https://r.ubiquity.tools/ +* BugReports: https://github.com/john-harrold/ubiquity/issues +* Date/Publication: 2020-01-21 07:50:02 UTC +* Number of recursive dependencies: 104 + +Run `revdep_details(,"ubiquity")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 9.3Mb + sub-directories of 1Mb or more: + doc 6.4Mb + ubinc 2.0Mb + ``` + +# ufs + +
+ +* Version: 0.3.1 +* Source code: https://github.com/cran/ufs +* URL: https://r-packages.gitlab.io/ufs +* BugReports: https://gitlab.com/r-packages/ufs/issues +* Date/Publication: 2019-08-22 17:30:02 UTC +* Number of recursive dependencies: 116 + +Run `revdep_details(,"ufs")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘viridis’ + All declared Imports should be used. + ``` + +* checking Rd cross-references ... NOTE + ``` + Packages unavailable to check Rd xrefs: ‘userfriendlyscience’, ‘behaviorchange’ + ``` + +# vidger + +
+ +* Version: 1.8.0 +* Source code: https://github.com/cran/vidger +* URL: https://github.com/btmonier/vidger, https://bioconductor.org/packages/release/bioc/html/vidger.html +* BugReports: https://github.com/btmonier/vidger/issues +* Date/Publication: 2020-04-27 +* Number of recursive dependencies: 113 + +Run `revdep_details(,"vidger")` for more info + +
+ +## In both + +* checking installed package size ... NOTE + ``` + installed size is 11.2Mb + sub-directories of 1Mb or more: + data 4.7Mb + doc 6.1Mb + ``` + diff --git a/revdep/revdep_cran.md b/revdep/revdep_cran.md new file mode 100644 index 000000000..78b22edab --- /dev/null +++ b/revdep/revdep_cran.md @@ -0,0 +1,6 @@ +## revdepcheck results + +We checked 98 reverse dependencies (77 from CRAN + 21 from BioConductor), comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 0 new problems + * We failed to check 0 packages diff --git a/scripts/rhub.R b/scripts/rhub.R new file mode 100644 index 000000000..4d75dfd3b --- /dev/null +++ b/scripts/rhub.R @@ -0,0 +1,5 @@ +rhub_output <- devtools::check_rhub( + env_vars = c("_R_CHECK_FORCE_SUGGESTS_" = "0"), + interactive = FALSE +) +rhub_output$web() diff --git a/tests/spelling.R b/tests/spelling.R index 6713838fc..56642bb41 100644 --- a/tests/spelling.R +++ b/tests/spelling.R @@ -1,3 +1,9 @@ -if(requireNamespace('spelling', quietly = TRUE)) - spelling::spell_check_test(vignettes = TRUE, error = FALSE, - skip_on_cran = TRUE) +# `devtools::spell_check()` + +# only check spelling if on CI and spelling is available +if (requireNamespace('spelling', quietly = TRUE)) { + if (isTRUE(as.logical(Sys.getenv("CI")))) { + spelling::spell_check_test(vignettes = TRUE, error = FALSE, + skip_on_cran = TRUE) + } +} diff --git a/tests/testthat.R b/tests/testthat.R index 525fa2e7e..5a8a1f937 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,4 +1,7 @@ -library(testthat) -library(GGally) -test_check("GGally") +if (requireNamespace('testthat', quietly = TRUE)) { + library(testthat) + library(GGally) + + test_check("GGally") +} diff --git a/tests/testthat/test-gg-plots.R b/tests/testthat/test-gg-plots.R index f99e53b5f..400b600e9 100644 --- a/tests/testthat/test-gg-plots.R +++ b/tests/testthat/test-gg-plots.R @@ -1,5 +1,7 @@ context("gg-plots") +# This file takes too long +testthat::skip_on_cran() data(tips, package = "reshape") data(nasa) diff --git a/tests/testthat/test-vig_ggally.R b/tests/testthat/test-vig_ggally.R new file mode 100644 index 000000000..ac4275f3c --- /dev/null +++ b/tests/testthat/test-vig_ggally.R @@ -0,0 +1,11 @@ +test_that("all vignetts are accounted for", { + testthat::skip_on_cran() + + # make sure vig dir exists + vig_dir <- file.path("..", "..", "vignettes") + testthat::skip_if_not(dir.exists(vig_dir)) + + vigs <- dir(vig_dir, pattern = "\\.Rmd$") + vigs <- sub(".Rmd", "", vigs, fixed = TRUE) + expect_equal(vignettes_for_ggally, vigs) +}) diff --git a/tests/testthat/test-zzz_ggpairs.R b/tests/testthat/test-zzz_ggpairs.R index 118840142..63467dc10 100644 --- a/tests/testthat/test-zzz_ggpairs.R +++ b/tests/testthat/test-zzz_ggpairs.R @@ -1,5 +1,7 @@ - context("ggpairs") +# This file takes too long +testthat::skip_on_cran() + data(tips, package = "reshape") expect_print <- function(p) { @@ -557,6 +559,9 @@ test_that("strip-top and strip-right", { test_that("subtypes", { + testthat::skip_on_cran() + testthat::skip_if_not_installed("Hmisc") + # list of the different plot types to check # continuous # points diff --git a/vignettes/ggally_plots.Rmd b/vignettes/ggally_plots.Rmd index f7872cc02..8f44d8739 100644 --- a/vignettes/ggally_plots.Rmd +++ b/vignettes/ggally_plots.Rmd @@ -1,12 +1,12 @@ --- -title: "List of available high-level plots" +title: "ggally_*(): List of available high-level plots" output: rmarkdown::html_vignette: toc: true author: GGally Team date: May 28, 2020 vignette: > - %\VignetteIndexEntry{List of available high-level plots} + %\VignetteIndexEntry{ggally_*(): List of available high-level plots} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/ggally_stats.Rmd b/vignettes/ggally_stats.Rmd index 984a8c040..6fe9c7f74 100644 --- a/vignettes/ggally_stats.Rmd +++ b/vignettes/ggally_stats.Rmd @@ -1,10 +1,10 @@ --- -title: "Additional statistics for ggplot2" +title: "stat_*(): Additional statistics for ggplot2" output: rmarkdown::html_vignette author: GGally team date: May 28, 2020 vignette: > - %\VignetteIndexEntry{Additional statistics for ggplot2} + %\VignetteIndexEntry{stat_*(): Additional statistics for ggplot2} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/ggbivariate.Rmd b/vignettes/ggbivariate.Rmd index ae89e9c16..2532f7cea 100644 --- a/vignettes/ggbivariate.Rmd +++ b/vignettes/ggbivariate.Rmd @@ -107,4 +107,4 @@ ggbivariate( ) ``` -For more customization options, you could directly use `ggduo()` (see also `vignette("ggduo")`). +For more customization options, you could directly use `ggduo()` (see also `vig_ggally("ggduo")`). diff --git a/vignettes/ggduo.Rmd b/vignettes/ggduo.Rmd index 82183adab..94b5e4a7b 100644 --- a/vignettes/ggduo.Rmd +++ b/vignettes/ggduo.Rmd @@ -239,5 +239,5 @@ You can customize the type of plots to display with the `types` argument. `types * `discrete`: when both x and y variables are discrete * `na`: when all x data and all y data is `NA` -The list of current valid `ggally_NAME` functions is visible in `vignette("ggally_plots")`. +The list of current valid `ggally_NAME` functions is visible in `vig_ggally("ggally_plots")`. diff --git a/vignettes/ggnostic.Rmd b/vignettes/ggnostic.Rmd index 26cb7dc92..c9ec4b3df 100644 --- a/vignettes/ggnostic.Rmd +++ b/vignettes/ggnostic.Rmd @@ -1,10 +1,10 @@ --- -title: "ggnostic(): Model diagnostics plot matrix" +title: "ggnostic(): Model diagnostics" output: rmarkdown::html_vignette author: Barret Schloerke date: Oct 1, 2016 vignette: > - %\VignetteIndexEntry{ggnostic(): Model diagnostics plot matrix} + %\VignetteIndexEntry{ggnostic(): Model diagnostics} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/ggpairs.Rmd b/vignettes/ggpairs.Rmd index f995cfe8a..e3f01bc52 100644 --- a/vignettes/ggpairs.Rmd +++ b/vignettes/ggpairs.Rmd @@ -71,7 +71,7 @@ To make adjustments to each section, a list of information may be supplied. The * `discrete`: a character string representing the tail end of a `ggally_NAME` function, or a custom function * `mapping`: if mapping is provided, only the section's mapping will be overwritten -The list of current valid `ggally_NAME` functions is visible in `vignette("ggally_plots")`. +The list of current valid `ggally_NAME` functions is visible in `vig_ggally("ggally_plots")`. ```{r ggpairs_section} library(ggplot2)