Skip to content

Commit 21df8dc

Browse files
authored
Don't install interp (#4806)
It's only needed for a small example and it uses RcppEigen which is having install problems on one version of R.
1 parent 6fc2430 commit 21df8dc

File tree

4 files changed

+17
-54
lines changed

4 files changed

+17
-54
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
mapproj=?ignore-before-r=3.5.0,
6767
multcomp=?ignore-before-r=3.5.0,
6868
quantreg=?ignore-before-r=3.5.0,
69-
interp=?ignore-before-r=3.5.0
7069
needs: check
7170

7271
- uses: r-lib/actions/check-r-package@v2

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Suggests:
5151
ggplot2movies,
5252
hexbin,
5353
Hmisc,
54-
interp,
5554
knitr,
5655
lattice,
5756
mapproj,

R/geom-contour.r

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#' 2D contours of a 3D surface
22
#'
3+
#' @description
34
#' ggplot2 can not draw true 3D surfaces, but you can use `geom_contour()`,
4-
#' `geom_contour_filled()`, and [geom_tile()] to visualise 3D surfaces in 2D. To
5-
#' specify a valid surface, the data must contain `x`, `y`, and `z` coordinates,
6-
#' and each unique combination of `x` and `y` can appear at most once.
7-
#' Contouring requires that the points can be rearranged so that the `z` values
8-
#' form a matrix, with rows corresponding to unique `x` values, and columns
9-
#' corresponding to unique `y` values. Missing entries are allowed, but contouring
10-
#' will only be done on cells of the grid with all four `z` values present. If
11-
#' your data is irregular, you can interpolate to a grid before visualising
12-
#' using the [interp::interp()] function from the `interp` package
13-
#' (or one of the interpolating functions from the `akima` package.)
5+
#' `geom_contour_filled()`, and [geom_tile()] to visualise 3D surfaces in 2D.
6+
#'
7+
#' These functions require regular data, where the `x` and `y` coordinates
8+
#' form an equally spaced grid, and each combination of `x` and `y` appears
9+
#' once. Missing values of `z` are allowed, but contouring will only work for
10+
#' grid points where all four corners are non-missing. If you have irregular
11+
#' data, you'll need to first interpolate on to a grid before visualising,
12+
#' using [interp::interp()], [akima::bilinear()], or similar.
1413
#'
1514
#' @eval rd_aesthetics("geom", "contour")
1615
#' @eval rd_aesthetics("geom", "contour_filled")
@@ -56,22 +55,6 @@
5655
#' v + geom_contour(colour = "red")
5756
#' v + geom_raster(aes(fill = density)) +
5857
#' geom_contour(colour = "white")
59-
#'
60-
#' # Irregular data
61-
#' if (requireNamespace("interp")) {
62-
#' # Use a dataset from the interp package
63-
#' data(franke, package = "interp")
64-
#' origdata <- as.data.frame(interp::franke.data(1, 1, franke))
65-
#' grid <- with(origdata, interp::interp(x, y, z))
66-
#' griddf <- subset(data.frame(x = rep(grid$x, nrow(grid$z)),
67-
#' y = rep(grid$y, each = ncol(grid$z)),
68-
#' z = as.numeric(grid$z)),
69-
#' !is.na(z))
70-
#' ggplot(griddf, aes(x, y, z = z)) +
71-
#' geom_contour_filled() +
72-
#' geom_point(data = origdata)
73-
#' } else
74-
#' message("Irregular data requires the 'interp' package")
7558
#' }
7659
geom_contour <- function(mapping = NULL, data = NULL,
7760
stat = "contour", position = "identity",

man/geom_contour.Rd

Lines changed: 8 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)