Skip to content

Commit

Permalink
tidy style: use newlines consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Apr 22, 2024
1 parent 4db51af commit 6e811da
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 16 deletions.
12 changes: 0 additions & 12 deletions R/container.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ new_container <- function(mode, type, operations, columns, ptype, call) {
# validate operation order and check duplicates
validate_oper_order(operations, mode, call)


# check columns

res <- list(mode = mode, type = type, operations = operations,
columns = columns, ptype = ptype)
class(res) <- "container"
Expand All @@ -82,13 +80,9 @@ print.container <- function(x, ...) {
invisible(x)
}


# ------------------------------------------------------------------------------

#' @export
fit.container <- function(object, .data, outcome, estimate, probabilities = c(),
time = c(), ...) {

# ------------------------------------------------------------------------------
# set columns via tidyselect

Expand All @@ -114,16 +108,12 @@ fit.container <- function(object, .data, outcome, estimate, probabilities = c(),
.data <- tibble::as_tibble(.data)
ptype <- .data[0,]



object <- set_container_type(object, .data[[dat$outcome]])

object <- new_container(object$mode, object$type,
operations = object$operations,
columns = dat, ptype = ptype, call = current_env())

# ------------------------------------------------------------------------------

num_oper <- length(object$operations)
for (op in 1:num_oper) {
object$operations[[op]] <- fit(object$operations[[op]], data, object)
Expand All @@ -136,7 +126,6 @@ fit.container <- function(object, .data, outcome, estimate, probabilities = c(),

#' @export
predict.container <- function(object, new_data, ...) {

# validate levels/classes
num_oper <- length(object$operations)
for (op in 1:num_oper) {
Expand Down Expand Up @@ -170,4 +159,3 @@ set_container_type <- function(object, y) {
# todo tune_args
# todo tidy
# todo extract_parameter_set_dials

1 change: 0 additions & 1 deletion R/numeric_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#' @param x A [container()].
#' @param upper_limit,lower_limit A numeric value, NA (for no truncation) or
#' [hardhat::tune()].

#' @export
adjust_numeric_range <- function(x, lower_limit = -Inf, upper_limit = Inf) {

Expand Down
1 change: 0 additions & 1 deletion R/probability_calibration.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#' package, such as [probably::cal_estimate_logistic()].
#' @export
adjust_probability_calibration <- function(x, calibrator) {

cls <- c("cal_binary", "cal_multinomial")
if (!inherits(calibrator, cls)) {
cli_abort("The {.arg calibrator} argument should be an object of //
Expand Down
1 change: 0 additions & 1 deletion R/reexport.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' @importFrom generics fit
#' @export
generics::fit
Expand Down
1 change: 0 additions & 1 deletion R/validation-rules.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
validate_oper_order <- function(ops, mode, call) {

oper_data <-
tibble::tibble(
name = purrr::map_chr(ops, ~ class(.x)[1]),
Expand Down

0 comments on commit 6e811da

Please sign in to comment.