Skip to content

Commit 6ac62cf

Browse files
committed
replace simplify_formula() with simplify()
1 parent 37da401 commit 6ac62cf

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

R/compat-plyr.R

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,28 +167,6 @@ join_keys <- function(x, y, by) {
167167
n = attr(keys, "n"))
168168
}
169169

170-
# Iterate through a formula and return a quoted version
171-
simplify_formula <- function(x) {
172-
if (length(x) == 2 && x[[1]] == as.name("~")) {
173-
return(simplify(x[[2]]))
174-
}
175-
if (length(x) < 3)
176-
return(list(x))
177-
op <- x[[1]]
178-
a <- x[[2]]
179-
b <- x[[3]]
180-
if (op == as.name("+") || op == as.name("*") || op ==
181-
as.name("~")) {
182-
c(simplify(a), simplify(b))
183-
}
184-
else if (op == as.name("-")) {
185-
c(simplify(a), bquote(-.(x), list(x = simplify(b))))
186-
}
187-
else {
188-
list(x)
189-
}
190-
}
191-
192170
# round a number to a given precision
193171
round_any <- function(x, accuracy, f = round) {
194172
check_numeric(x)

R/facet-.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ f_as_facets <- function(f) {
529529
env <- f_env(f) %||% globalenv()
530530

531531
# as.quoted() handles `+` specifications
532-
vars <- simplify_formula(f)
532+
vars <- simplify(f)
533533

534534
# `.` in formulas is discarded
535535
vars <- vars[!vapply(vars, identical, logical(1), as.name("."))]

0 commit comments

Comments
 (0)