Skip to content

Commit

Permalink
Merge pull request #441 from tidymodels/linting
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt authored Aug 8, 2023
2 parents 98497da + ea49dee commit e5c36f2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/class-mcc.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ mcc_binary <- function(data) {
d3 <- tn + fp
d4 <- tn + fn

if (d1 == 0 | d2 == 0 | d3 == 0 | d4 == 0) {
if (d1 == 0 || d2 == 0 || d3 == 0 || d4 == 0) {
return(NA)
}

Expand Down
1 change: 0 additions & 1 deletion R/class-npv.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ npv_table_impl <- function(data,

npv_binary <- function(data, event_level, prevalence = NULL) {
positive <- pos_val(data, event_level)
negative <- neg_val(data, event_level)

if (is.null(prevalence)) {
prevalence <- sum(data[, positive]) / sum(data)
Expand Down
2 changes: 1 addition & 1 deletion R/import-standalone-survival.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
event_type_to_01 <- !(.extract_surv_type(surv) %in% c("interval", "interval2", "mstate"))
if (
event_type_to_01 &&
(identical(un_vals, 1:2) | identical(un_vals, c(1.0, 2.0)))) {
(identical(un_vals, 1:2) || identical(un_vals, c(1.0, 2.0)))) {
res <- res - 1
}
res
Expand Down
2 changes: 1 addition & 1 deletion R/prob-brier_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ brier_ind <- function(truth, estimate, case_weights = NULL) {
estimate <- matrix(estimate, ncol = 1)
}
# In the binary case:
if (ncol(estimate) == 1 & ncol(truth) == 2) {
if (ncol(estimate) == 1 && ncol(truth) == 2) {
estimate <- unname(estimate)
estimate <- vec_cbind(estimate, 1 - estimate, .name_repair = "unique_quiet")
}
Expand Down
1 change: 0 additions & 1 deletion data-raw/dyn-surv-metrics/generate_metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ if (FALSE) {
brier_churn_res <- as.data.frame(noSplit$Brier$score)
save(brier_churn_res, file = "brier_churn_res.RData")
}

0 comments on commit e5c36f2

Please sign in to comment.