Skip to content

Commit 79866e8

Browse files
committed
remove orphan functions
1 parent 0bfbcc3 commit 79866e8

File tree

8 files changed

+0
-101
lines changed

8 files changed

+0
-101
lines changed

R/geom-hex.R

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -117,34 +117,3 @@ GeomHex <- ggproto("GeomHex", Geom,
117117

118118
rename_size = TRUE
119119
)
120-
121-
122-
# Draw hexagon grob
123-
# Modified from code by Nicholas Lewin-Koh and Martin Maechler
124-
#
125-
# @param x positions of hex centres
126-
# @param y positions
127-
# @param size vector of hex sizes
128-
# @param gp graphical parameters
129-
# @keyword internal
130-
#
131-
# THIS IS NO LONGER USED BUT LEFT IF CODE SOMEWHERE ELSE RELIES ON IT
132-
hexGrob <- function(x, y, size = rep(1, length(x)), gp = gpar()) {
133-
if (length(y) != length(x)) {
134-
cli::cli_abort("{.arg x} and {.arg y} must have the same length")
135-
}
136-
137-
dx <- resolution(x, FALSE)
138-
dy <- resolution(y, FALSE) / sqrt(3) / 2 * 1.15
139-
140-
hexC <- hexbin::hexcoords(dx, dy, n = 1)
141-
142-
n <- length(x)
143-
144-
polygonGrob(
145-
x = rep.int(hexC$x, n) * rep(size, each = 6) + rep(x, each = 6),
146-
y = rep.int(hexC$y, n) * rep(size, each = 6) + rep(y, each = 6),
147-
default.units = "native",
148-
id.lengths = rep(6, n), gp = gp
149-
)
150-
}

R/guides-.R

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -870,19 +870,6 @@ include_layer_in_guide <- function(layer, matched) {
870870
isTRUE(layer$show.legend)
871871
}
872872

873-
# Simplify legend position to one of horizontal/vertical/inside
874-
legend_position <- function(position) {
875-
if (length(position) == 1) {
876-
if (position %in% c("top", "bottom")) {
877-
"horizontal"
878-
} else {
879-
"vertical"
880-
}
881-
} else {
882-
"inside"
883-
}
884-
}
885-
886873
# resolve the guide from the scale and guides
887874
resolve_guide <- function(aesthetic, scale, guides, default = "none", null = "none") {
888875
guides[[aesthetic]] %||% scale$guide %|W|% default %||% null

R/labeller.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,6 @@ label_parsed <- function(labels, multi_line = TRUE) {
173173
}
174174
class(label_parsed) <- c("function", "labeller")
175175

176-
find_names <- function(expr) {
177-
if (is.call(expr)) {
178-
unlist(lapply(expr[-1], find_names))
179-
} else if (is.name(expr)) {
180-
as.character(expr)
181-
}
182-
}
183-
184176
#' Label with mathematical expressions
185177
#'
186178
#' `label_bquote()` offers a flexible way of labelling

R/layer.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,6 @@ Layer <- ggproto("Layer", NULL,
463463
}
464464
)
465465

466-
is.layer <- function(x) inherits(x, "Layer")
467-
468466
check_subclass <- function(x, subclass,
469467
argname = to_lower_ascii(subclass),
470468
env = parent.frame(),

R/performance.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ mat_2_df <- function(x, col_names = colnames(x)) {
1010
data_frame0(!!!cols, .size = nrow(x))
1111
}
1212

13-
df_col <- function(x, name) .subset2(x, name)
14-
1513
df_rows <- function(x, i) {
1614
cols <- lapply(x, `[`, i = i)
1715
data_frame0(!!!cols, .size = length(i))

R/quick-plot.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,3 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE,
173173
#' @export
174174
#' @rdname qplot
175175
quickplot <- qplot
176-
177-
is.constant <- function(x) {
178-
is_I_call <- function(x) is.call(x) && identical(x[[1]], quote(I))
179-
vapply(x, is_I_call, logical(1))
180-
}

R/scale-view.R

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,6 @@ view_scale_secondary <- function(scale, limits = scale$get_limits(),
9090
}
9191
}
9292

93-
view_scale_empty <- function() {
94-
ggproto(NULL, ViewScale,
95-
is_empty = function() TRUE,
96-
is_discrete = function() NA,
97-
dimension = function() c(0, 1),
98-
get_limits = function() c(0, 1),
99-
get_breaks = function() NULL,
100-
get_breaks_minor = function() NULL,
101-
get_labels = function(breaks = NULL) breaks,
102-
rescale = function(x) cli::cli_abort("Not implemented."),
103-
map = function(x) cli::cli_abort("Not implemented."),
104-
make_title = function(title) title,
105-
break_positions = function() NULL,
106-
break_positions_minor = function() NULL
107-
)
108-
}
109-
11093
ViewScale <- ggproto("ViewScale", NULL,
11194
# map, rescale, and make_title need a reference
11295
# to the original scale

R/utilities.R

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,6 @@ waiver <- function() structure(list(), class = "waiver")
190190

191191
is.waive <- function(x) inherits(x, "waiver")
192192

193-
194-
rescale01 <- function(x) {
195-
rng <- range(x, na.rm = TRUE)
196-
(x - rng[1]) / (rng[2] - rng[1])
197-
}
198-
199193
pal_binned <- function(palette) {
200194
function(x) {
201195
palette(length(x))
@@ -310,15 +304,6 @@ compact <- function(x) {
310304

311305
is.formula <- function(x) inherits(x, "formula")
312306

313-
deparse2 <- function(x) {
314-
y <- deparse(x, backtick = TRUE)
315-
if (length(y) == 1) {
316-
y
317-
} else {
318-
paste0(y[[1]], "...")
319-
}
320-
}
321-
322307
dispatch_args <- function(f, ...) {
323308
args <- list(...)
324309
formals <- formals(f)
@@ -353,14 +338,6 @@ with_seed_null <- function(seed, code) {
353338
}
354339
}
355340

356-
seq_asc <- function(to, from) {
357-
if (to > from) {
358-
integer()
359-
} else {
360-
to:from
361-
}
362-
}
363-
364341
# Needed to trigger package loading
365342
#' @importFrom tibble tibble
366343
NULL

0 commit comments

Comments
 (0)