Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upkeep 2024-10 #6156

Merged
merged 19 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
cache-version: 3
extra-packages: >
any::rcmdcheck,
Hmisc=?ignore-before-r=4.1.0,
Hmisc=?ignore-before-r=4.2.0,
quantreg=?ignore-before-r=4.3.0
needs: check

Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ggplot2
Version: 3.5.1.9000
Title: Create Elegant Data Visualisations Using the Grammar of Graphics
Version: 3.5.1.9000
Authors@R: c(
person("Hadley", "Wickham", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0003-4757-117X")),
Expand Down Expand Up @@ -30,7 +30,7 @@ License: MIT + file LICENSE
URL: https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2
BugReports: https://github.com/tidyverse/ggplot2/issues
Depends:
R (>= 3.5)
R (>= 4.0)
Imports:
cli,
grDevices,
Expand Down Expand Up @@ -75,6 +75,7 @@ VignetteBuilder:
knitr
Config/Needs/website: ggtext, tidyr, forcats, tidyverse/tidytemplate
Config/testthat/edition: 3
Config/usethis/last-upkeep: 2024-10-24
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2020 ggplot2 authors
Copyright (c) 2024 ggplot2 core developer team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion R/stat-ellipse.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @references John Fox and Sanford Weisberg (2011). An \R Companion to
#' Applied Regression, Second Edition. Thousand Oaks CA: Sage. URL:
#' \url{https://socialsciences.mcmaster.ca/jfox/Books/Companion/}
#' \url{https://www.john-fox.ca/Companion/}
#' @references Michael Friendly. Georges Monette. John Fox. "Elliptical Insights: Understanding Statistical Methods through Elliptical Geometry."
#' Statist. Sci. 28 (1) 1 - 39, February 2013. URL: \url{https://projecteuclid.org/journals/statistical-science/volume-28/issue-1/Elliptical-Insights-Understanding-Statistical-Methods-through-Elliptical-Geometry/10.1214/12-STS402.full}
#'
Expand Down
15 changes: 9 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ output: github_document

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, echo = FALSE}
```{r}
#| echo: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```

# ggplot2 <a href="https://ggplot2.tidyverse.org"><img src="man/figures/logo.png" align="right" height="138" /></a>
# ggplot2 <a href="https://ggplot2.tidyverse.org"><img src="man/figures/logo.png" align="right" height="138" alt="ggplot2 website" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/tidyverse/ggplot2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidyverse/ggplot2/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/tidyverse/ggplot2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2?branch=main)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
[![Codecov test coverage](https://codecov.io/gh/tidyverse/ggplot2/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2)
<!-- badges: end -->

## Overview
Expand All @@ -26,7 +27,8 @@ ggplot2 is a system for declaratively creating graphics, based on [The Grammar o

## Installation

```{r, eval = FALSE}
```{r}
#| eval: false
# The easiest way to get ggplot2 is to install the whole tidyverse:
install.packages("tidyverse")

Expand All @@ -40,13 +42,14 @@ pak::pak("tidyverse/ggplot2")

## Cheatsheet

<a href="https://github.com/rstudio/cheatsheets/blob/master/data-visualization.pdf"><img src="https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/data-visualization-cheatsheet-thumbs.png" width="630" height="252"/></a>
<a href="https://github.com/rstudio/cheatsheets/blob/master/data-visualization.pdf"><img src="https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/data-visualization-cheatsheet-thumbs.png" width="630" height="252" alt="ggplot2 cheatsheet" /></a>

## Usage

It's hard to succinctly describe how ggplot2 works because it embodies a deep philosophy of visualisation. However, in most cases you start with `ggplot()`, supply a dataset and aesthetic mapping (with `aes()`). You then add on layers (like `geom_point()` or `geom_histogram()`), scales (like `scale_colour_brewer()`), faceting specifications (like `facet_wrap()`) and coordinate systems (like `coord_flip()`).

```{r example}
```{r}
#| label: example
#| fig.alt: "Scatterplot of engine displacement versus highway miles per
#| gallon, for 234 cars coloured by 7 'types' of car. The displacement and miles
#| per gallon are inversely correlated."
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# ggplot2 <a href="https://ggplot2.tidyverse.org"><img src="man/figures/logo.png" align="right" height="138" /></a>
# ggplot2 <a href="https://ggplot2.tidyverse.org"><img src="man/figures/logo.png" align="right" height="138" alt="ggplot2 website" /></a>

<!-- badges: start -->

[![R-CMD-check](https://github.com/tidyverse/ggplot2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidyverse/ggplot2/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/tidyverse/ggplot2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2?branch=main)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
[![Codecov test
coverage](https://codecov.io/gh/tidyverse/ggplot2/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2)
<!-- badges: end -->

## Overview
Expand All @@ -35,7 +35,7 @@ pak::pak("tidyverse/ggplot2")

## Cheatsheet

<a href="https://github.com/rstudio/cheatsheets/blob/master/data-visualization.pdf"><img src="https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/data-visualization-cheatsheet-thumbs.png" width="630" height="252"/></a>
<a href="https://github.com/rstudio/cheatsheets/blob/master/data-visualization.pdf"><img src="https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/data-visualization-cheatsheet-thumbs.png" width="630" height="252" alt="ggplot2 cheatsheet" /></a>

## Usage

Expand Down
22 changes: 21 additions & 1 deletion man/figures/lifecycle-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion man/figures/lifecycle-experimental.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 29 additions & 1 deletion man/figures/lifecycle-stable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion man/figures/lifecycle-superseded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/stat_ellipse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions pkgdown/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions tests/testthat/_snaps/aes-calculated.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

Duplicated aesthetics after name standardisation: colour

# calculated aesthetics throw warnings when lengths mismatch

Failed to apply `after_stat()` for the following aesthetic: colour.

---

Failed to apply `after_scale()` for the following aesthetic: colour.

# A deprecated warning is issued when stat(var) or ..var.. is used

`stat(foo)` was deprecated in ggplot2 3.4.0.
Expand Down
36 changes: 36 additions & 0 deletions tests/testthat/_snaps/aes-setting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# aesthetic parameters match length of data

Code
set_colours(rep("red", 2))
Condition
Error in `geom_point()`:
! Problem while setting up geom aesthetics.
i Error occurred in the 1st layer.
Caused by error in `check_aesthetics()`:
! Aesthetics must be either length 1 or the same as the data (5).
x Fix the following mappings: `colour`.

---

Code
set_colours(rep("red", 3))
Condition
Error in `geom_point()`:
! Problem while setting up geom aesthetics.
i Error occurred in the 1st layer.
Caused by error in `check_aesthetics()`:
! Aesthetics must be either length 1 or the same as the data (5).
x Fix the following mappings: `colour`.

---

Code
set_colours(rep("red", 4))
Condition
Error in `geom_point()`:
! Problem while setting up geom aesthetics.
i Error occurred in the 1st layer.
Caused by error in `check_aesthetics()`:
! Aesthetics must be either length 1 or the same as the data (5).
x Fix the following mappings: `colour`.

40 changes: 40 additions & 0 deletions tests/testthat/_snaps/aes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# accessing an undefined variable results in an error

Code
get_layer_data(p)
Condition
Error in `geom_point()`:
! Problem while computing aesthetics.
i Error occurred in the 1st layer.
Caused by error:
! object 'foo' not found

# aes standardises aesthetic names

Duplicated aesthetics after name standardisation: colour

# warn_for_aes_extract_usage() warns for discouraged uses of $ and [[ within aes()

Use of `df$x` is discouraged.
i Use `x` instead.

---

Use of `df[["x"]]` is discouraged.
i Use `.data[["x"]]` instead.

---

Use of `df$x` is discouraged.
i Use `x` instead.

# warn_for_aes_extract_usage() does not evaluate function calls

Use of `df$x` is discouraged.
i Use `x` instead.

# Warnings are issued when plots use discouraged extract usage within aes()

Use of `df$x` is discouraged.
i Use `x` instead.

# aes evaluation fails with unknown input

Unknown input: <environment>
Expand Down
16 changes: 16 additions & 0 deletions tests/testthat/_snaps/coord-.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@

`coord()` has not implemented a `range()` method.

# check coord limits errors only on bad inputs

Code
check_coord_limits(xlim(1, 2))
Condition
Error:
! `xlim(1, 2)` must be a vector of length 2, not a <ScaleContinuousPosition> object.

---

Code
check_coord_limits(1:3)
Condition
Error:
! `1:3` must be a vector of length 2, not an integer vector of length 3.

8 changes: 8 additions & 0 deletions tests/testthat/_snaps/coord-transform.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# warnings are generated when coord_trans() results in new infinite values

Transformation introduced infinite values in y-axis

---

Transformation introduced infinite values in x-axis

# coord_trans() throws error when limits are badly specified

`xlim` must be a vector of length 2, not a <ScaleContinuousPosition> object.
Expand Down
Loading
Loading