Skip to content

Commit 152caec

Browse files
authored
remove unused functions (#698)
closes #610
1 parent f6b7972 commit 152caec

File tree

6 files changed

+0
-82
lines changed

6 files changed

+0
-82
lines changed

R/aaa_models.R

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,6 @@ check_mode_with_no_engine <- function(cls, mode) {
260260
}
261261
}
262262

263-
check_engine_val <- function(eng) {
264-
if (rlang::is_missing(eng) || length(eng) != 1 || !is.character(eng))
265-
rlang::abort("Please supply a character string for an engine (e.g. `'lm'`).")
266-
invisible(NULL)
267-
}
268-
269263
check_arg_val <- function(arg) {
270264
if (rlang::is_missing(arg) || length(arg) != 1 || !is.character(arg))
271265
rlang::abort("Please supply a character string for the argument.")

R/descriptors.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -320,18 +320,6 @@ has_exprs <- function(x) {
320320
is_symbolic(x)
321321
}
322322

323-
make_descr <- function(object) {
324-
if (length(object$args) > 0)
325-
expr_main <- map_lgl(object$args, has_exprs)
326-
else
327-
expr_main <- FALSE
328-
if (length(object$eng_args) > 0)
329-
expr_eng_args <- map_lgl(object$eng_args, has_exprs)
330-
else
331-
expr_eng_args <- FALSE
332-
any(expr_main) | any(expr_eng_args)
333-
}
334-
335323
# Locate descriptors -----------------------------------------------------------
336324

337325
# take a model spec, see if any require descriptors

R/engine_docs.R

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -289,22 +289,6 @@ sort_c <- function(x) {
289289
withr::with_collate("C", sort(x))
290290
}
291291

292-
get_sorted_unique_engines <- function(x) {
293-
engines <- x$engine
294-
engines <- unique(engines)
295-
engines <- sort_c(engines)
296-
engines
297-
}
298-
combine_prefix_with_engines <- function(prefix, engines) {
299-
if (length(engines) == 0L) {
300-
engines <- "No engines currently available"
301-
} else {
302-
engines <- glue::glue_collapse(engines, sep = ", ")
303-
}
304-
305-
glue::glue("{prefix} {engines}")
306-
}
307-
308292
# ------------------------------------------------------------------------------
309293

310294
#' Locate and show errors/warnings in engine-specific documentation

R/fit.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ inher <- function(x, cls, cl) {
360360

361361
# ------------------------------------------------------------------------------
362362

363-
364-
has_both_or_none <- function(a, b)
365-
(!is.null(a) & is.null(b)) | (is.null(a) & !is.null(b))
366-
367363
check_interface <- function(formula, data, cl, model) {
368364
inher(formula, "formula", cl)
369365
inher(data, c("data.frame", "tbl_spark"), cl)

R/misc.R

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ levels_from_formula <- function(f, dat) {
119119
res
120120
}
121121

122-
is_spark <- function(x)
123-
isTRUE(unname(x$method$fit$func["pkg"] == "sparklyr"))
124-
125-
126122
#' @export
127123
#' @keywords internal
128124
#' @rdname add_on_exports
@@ -211,17 +207,6 @@ check_outcome <- function(y, spec) {
211207
invisible(NULL)
212208
}
213209

214-
215-
# Get's a character string of varible names used as the outcome
216-
# in a terms object
217-
terms_y <- function(x) {
218-
att <- attributes(x)
219-
resp_ind <- att$response
220-
y_expr <- att$predvars[[resp_ind + 1]]
221-
all.vars(y_expr)
222-
}
223-
224-
225210
# ------------------------------------------------------------------------------
226211

227212
#' @export

tests/testthat/test_misc.R

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,6 @@ test_that('other objects', {
4141

4242
# ------------------------------------------------------------------------------
4343

44-
context("getting y names from terms")
45-
46-
test_that('getting y names from terms', {
47-
48-
expect_equal(
49-
parsnip:::terms_y(lm(cbind(mpg, disp) ~., data = mtcars)$terms),
50-
c("mpg", "disp")
51-
)
52-
53-
expect_equal(
54-
parsnip:::terms_y(lm(mpg ~., data = mtcars)$terms),
55-
"mpg"
56-
)
57-
58-
expect_equal(
59-
parsnip:::terms_y(lm(log(mpg) ~., data = mtcars)$terms),
60-
"mpg"
61-
)
62-
63-
expect_equal(
64-
parsnip:::terms_y(terms( ~., data = mtcars)),
65-
character(0)
66-
)
67-
68-
69-
})
70-
71-
# ------------------------------------------------------------------------------
72-
7344
test_that('S3 method dispatch/registration', {
7445

7546
expect_error(

0 commit comments

Comments
 (0)