Skip to content

Commit 8e68faf

Browse files
committed
Update ggplot2 inheritance helpers
1 parent b2f2efc commit 8e68faf

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ importFrom(ggplot2,aes)
3939
importFrom(ggplot2,autoplot)
4040
importFrom(ggplot2,ggplot_build)
4141
importFrom(ggplot2,ggplot_gtable)
42+
importFrom(ggplot2,is_waiver)
4243
importFrom(ggplot2,rel)
4344
importFrom(ggplot2,waiver)
4445
importFrom(grid,unit)

R/phylepic-package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
## usethis namespace: start
55
#' @importFrom ggplot2 waiver
6+
#' @importFrom ggplot2 is_waiver
67
#' @importFrom ggplot2 aes
78
#' @importFrom grid unit
89
#' @importFrom rlang .data

R/vnd_ggplot2_bin.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ compute_bins <- function(x, scale = NULL, breaks = NULL, binwidth = NULL, bins =
136136
center = NULL, boundary = NULL,
137137
closed = c("right", "left")) {
138138

139-
range <- if (is.scale(scale)) scale$dimension() else range(x)
139+
range <- if (ggplot2::is_scale(scale)) scale$dimension() else range(x)
140140
#@ check_length(range, 2L)
141141

142142
if (!is.null(breaks)) {
143143
breaks <- allow_lambda(breaks)
144144
if (is.function(breaks)) {
145145
breaks <- breaks(x)
146146
}
147-
if (is.scale(scale) && !scale$is_discrete()) {
147+
if (ggplot2::is_scale(scale) && !scale$is_discrete()) {
148148
breaks <- scale$transform(breaks)
149149
}
150150
#@ check_numeric(breaks)

R/vnd_ggplot2_utils.R

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
# SOFTWARE.
2222

23-
is_waiver <- function(x) {
24-
inherits(x, "waiver")
25-
}
26-
2723
ggname <- function(prefix, grob) {
2824
grob$name <- grid::grobName(grob, prefix)
2925
grob
@@ -52,5 +48,3 @@ dual_param <- function(x, default = list(x = NULL, y = NULL)) {
5248
allow_lambda <- function(x) {
5349
if (rlang::is_formula(x)) rlang::as_function(x) else x
5450
}
55-
56-
is.scale <- function(x) inherits(x, "Scale")

man/phylepic-package.Rd

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

0 commit comments

Comments
 (0)