Skip to content

Commit

Permalink
Merge branch 'master' into rc-v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke authored Nov 20, 2023
2 parents ef58fcf + 9e7228c commit ea2062f
Show file tree
Hide file tree
Showing 71 changed files with 320 additions and 236 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Depends:
ggplot2 (>= 3.3.4)
Imports:
dplyr (>= 1.0.0),
tidyr (>= 1.3.0),
grDevices,
grid,
ggstats,
Expand All @@ -40,7 +41,6 @@ Imports:
plyr (>= 1.8.3),
progress,
RColorBrewer,
reshape (>= 0.8.5),
rlang,
scales (>= 1.1.0),
utils
Expand Down Expand Up @@ -70,7 +70,7 @@ Suggests:
emmeans,
vdiffr
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
SystemRequirements: openssl
Encoding: UTF-8
Language: en-US
Expand Down
10 changes: 6 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ export(wrap_fn_with_params)
export(wrapp)
import(RColorBrewer)
import(ggplot2)
import(plyr)
import(utils)
importFrom(dplyr,"%>%")
importFrom(dplyr,group_by)
importFrom(dplyr,rename)
importFrom(dplyr,summarise)
importFrom(ggstats,StatCross)
importFrom(ggstats,StatProp)
importFrom(ggstats,StatWeightedMean)
Expand Down Expand Up @@ -163,9 +165,8 @@ importFrom(grid,upViewport)
importFrom(grid,viewport)
importFrom(gtable,gtable_filter)
importFrom(lifecycle,deprecate_soft)
importFrom(reshape,melt)
importFrom(reshape,melt.data.frame)
importFrom(reshape,melt.default)
importFrom(plyr,ddply)
importFrom(plyr,summarize)
importFrom(rlang,"%||%")
importFrom(stats,anova)
importFrom(stats,complete.cases)
Expand All @@ -182,6 +183,7 @@ importFrom(stats,spline)
importFrom(stats,symnum)
importFrom(stats,terms)
importFrom(stats,time)
importFrom(tidyr,pivot_longer)
importFrom(utils,capture.output)
importFrom(utils,head)
importFrom(utils,installed.packages)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Bug fixes

* removed dependency on reshape2 (#475)
* Reverse ordering of y-axis in `ggally_count()` (#420)
* Facets ordering in `ggcoef_compare()` (#426)
* Fix in `ggcoef_compare()` when using tidy selectors for
Expand All @@ -11,6 +12,7 @@
* New default tidier for `ggcoef_model()`, now using
`broom.helpers::tidy_with_broom_or_parameters()` (#432)
* Re-export methods from and redirect vignettes to the `{ggstats}` package (#452, #457)
* Replaced ..scaled.. with after_stat(scaled) in ggscatmat (#467)


# GGally 2.1.2
Expand Down
41 changes: 41 additions & 0 deletions R/data-baseball.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#' Yearly batting records for all major league baseball players
#'
#' This data frame contains batting statistics for a subset of players
#' collected from \url{http://www.baseball-databank.org/}. There are a total
#' of 21,699 records, covering 1,228 players from 1871 to 2007. Only players
#' with more 15 seasons of play are included.
#'
#' @section Variables:
#' Variables:
#' \itemize{
#' \item id, unique player id
#' \item year, year of data
#' \item stint
#' \item team, team played for
#' \item lg, league
#' \item g, number of games
#' \item ab, number of times at bat
#' \item r, number of runs
#' \item h, hits, times reached base because of a batted, fair ball without
#' error by the defense
#' \item X2b, hits on which the batter reached second base safely
#' \item X3b, hits on which the batter reached third base safely
#' \item hr, number of home runs
#' \item rbi, runs batted in
#' \item sb, stolen bases
#' \item cs, caught stealing
#' \item bb, base on balls (walk)
#' \item so, strike outs
#' \item ibb, intentional base on balls
#' \item hbp, hits by pitch
#' \item sh, sacrifice hits
#' \item sf, sacrifice flies
#' \item gidp, ground into double play
#' }
#' @docType data
#' @name baseball
#' @usage baseball
#' @format A 21699 x 22 data frame
#' @references \url{http://www.baseball-databank.org/}
#' @keywords datasets
"baseball"
26 changes: 26 additions & 0 deletions R/data-tips.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#' Tipping data
#'
#'
#' One waiter recorded information about each tip he received over a
#' period of a few months working in one restaurant. He collected several
#' variables:
#'
#' \itemize{
#' \item tip in dollars,
#' \item bill in dollars,
#' \item sex of the bill payer,
#' \item whether there were smokers in the party,
#' \item day of the week,
#' \item time of day,
#' \item size of the party.
#' }
#'
#' In all he recorded 244 tips. The data was reported in a collection of
#' case studies for business statistics (Bryant & Smith 1995).
#'
#' @references Bryant, P. G. and Smith, M (1995) \emph{Practical Data
#' Analysis: Case Studies in Business Statistics}. Homewood, IL: Richard D.
#' Irwin Publishing:
#' @format A data frame with 244 rows and 7 variables
#' @keywords datasets
"tips"
2 changes: 1 addition & 1 deletion R/deprecated.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ v1_ggmatrix_theme <- function() {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_cor_v1_5(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")))
#'
#' # display with no grid
Expand Down
43 changes: 18 additions & 25 deletions R/gg-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ ggally_points <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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")))
Expand Down Expand Up @@ -210,7 +210,7 @@ ggally_smooth_lm <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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(
Expand Down Expand Up @@ -275,7 +275,7 @@ ggally_density <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip")))
#' # display with grid
#' p_(ggally_cor(
Expand Down Expand Up @@ -607,7 +607,7 @@ ggally_statistic <- function(
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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(
Expand Down Expand Up @@ -645,7 +645,7 @@ ggally_box_no_facet <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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(
Expand Down Expand Up @@ -681,7 +681,7 @@ ggally_dot_no_facet <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_dot_and_box(
#' tips,
#' mapping = ggplot2::aes(x = total_bill, y = sex, color = sex),
Expand Down Expand Up @@ -768,7 +768,7 @@ ggally_dot_and_box_no_facet <- function(data, mapping, ..., boxPlot = TRUE) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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, ...) {
Expand Down Expand Up @@ -818,7 +818,7 @@ ggally_facethist <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_facetdensity(tips, mapping = ggplot2::aes(x = total_bill, y = sex)))
#' p_(ggally_facetdensity(
#' tips,
Expand All @@ -842,7 +842,7 @@ ggally_facetdensity <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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(
Expand Down Expand Up @@ -943,7 +943,7 @@ ggally_facetdensitystrip <- function(data, mapping, ..., den_strip = FALSE) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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) {
Expand Down Expand Up @@ -985,7 +985,7 @@ ggally_densityDiag <- function(data, mapping, ..., rescale = FALSE) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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) {
Expand Down Expand Up @@ -1128,14 +1128,7 @@ get_x_axis_labels <- function(p, xRange) {
}
NULL
}
name <-
if (packageVersion("ggplot2") >= 3.3) {
"title"
} else {
"axis.text.x"
}

xAxisGrob <- get_raw_grob_by_name(axisTable, name)
xAxisGrob <- get_raw_grob_by_name(axisTable, "title")

axisBreaks <- as.numeric(xAxisGrob$label)

Expand Down Expand Up @@ -1196,7 +1189,7 @@ get_x_axis_labels <- function(p, xRange) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_diagAxis(tips, ggplot2::aes(x = tip)))
#' p_(ggally_diagAxis(tips, ggplot2::aes(x = sex)))
ggally_diagAxis <- function(
Expand Down Expand Up @@ -1320,7 +1313,7 @@ ggally_diagAxis <- function(
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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, ...) {
Expand Down Expand Up @@ -1355,7 +1348,7 @@ ggally_facetbar <- function(data, mapping, ...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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
Expand Down Expand Up @@ -1457,7 +1450,7 @@ ggally_ratio <- function(
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex)))
#' p_(ggally_count(tips, mapping = ggplot2::aes(x = smoker, y = sex, fill = day)))
#'
Expand Down Expand Up @@ -1714,7 +1707,7 @@ ggally_naDiag <- function(...) {
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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)))
Expand Down Expand Up @@ -1766,7 +1759,7 @@ ggally_autopointDiag <- function(data, mapping, ...) {
#' p_ <- GGally::print_if_interactive
#'
#' if (require(Hmisc)) {
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_summarise_by(tips, mapping = aes(x = total_bill, y = day)))
#' p_(ggally_summarise_by(tips, mapping = aes(x = day, y = total_bill)))
#'
Expand Down
2 changes: 1 addition & 1 deletion R/ggally_colbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_colbar(tips, mapping = aes(x = smoker, y = sex)))
#' p_(ggally_rowbar(tips, mapping = aes(x = smoker, y = sex)))
#'
Expand Down
6 changes: 3 additions & 3 deletions R/ggally_cross.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggally_cross(tips, mapping = aes(x = smoker, y = sex)))
#' p_(ggally_cross(tips, mapping = aes(x = day, y = time)))
#'
Expand Down Expand Up @@ -116,7 +116,7 @@ ggally_cross <- function(data, mapping, ..., scale_max_size = 20, geom_text_args
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' 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)))
Expand Down Expand Up @@ -204,7 +204,7 @@ ggally_tableDiag <- function(data, mapping, keep.zero.cells = FALSE, ..., geom_t
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#'
#' # differences with ggally_table()
#' p_(ggally_table(tips, mapping = aes(x = day, y = time)))
Expand Down
2 changes: 1 addition & 1 deletion R/ggaly_trends.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' tips_f <- tips
#' tips_f$day <- factor(tips$day, c("Thur", "Fri", "Sat", "Sun"))
#'
Expand Down
2 changes: 1 addition & 1 deletion R/ggbivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' # Small function to display plots only if it's interactive
#' p_ <- GGally::print_if_interactive
#'
#' data(tips, package = "reshape")
#' data(tips)
#' p_(ggbivariate(tips, "smoker", c("day", "time", "sex", "tip")))
#'
#' # Personalize plot title and legend title
Expand Down
Loading

0 comments on commit ea2062f

Please sign in to comment.