Skip to content

Commit

Permalink
dplyr adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
adibender committed Feb 24, 2024
1 parent b09683f commit d968dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/model-evaluation.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ as.data.frame.crps <- function(x, row.names = NULL, optional = FALSE, ...) {
m$method <- attr(x, "dimnames")[[1]]

m <- m %>%
pivot_longer(cols = -.data$method, values_to = "IBS") %>%
dplyr::rename(time = .data$name)
pivot_longer(cols = -one_of("method"), values_to = "IBS") %>%
dplyr::rename(time = "name")

}
6 changes: 3 additions & 3 deletions R/sim-pexp.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ sim_pexp <- function(formula, data, cut) {
status = 1L * (.data$time <= max(cut)),
time = pmin(.data$time, max(cut)))

suppressMessages(
suppressMessages(
sim_df <- sim_df %>%
left_join(select(data, -.data$time, -.data$status))
left_join(select(data, -all_of(c("time", "status"))))
)

attr(sim_df, "id_var") <- "id"
Expand All @@ -166,7 +166,7 @@ sim_pexp <- function(formula, data, cut) {
attr(sim_df, "tz_var") <- tz_vars
attr(sim_df, "cens_value") <- 0
attr(sim_df, "breaks") <- cut
attr(sim_df, "tz") <- imap(tz_vars, ~select(sim_df, .x) %>%
attr(sim_df, "tz") <- imap(tz_vars, ~select(sim_df, all_of(.x)) %>%
pull(.x) %>% unique()) %>% flatten()
if (exists("ll_funs")) attr(sim_df, "ll_funs") <- ll_funs
if (exists("cumu_funs")) attr(sim_df, "cumu_funs") <- cumu_funs
Expand Down

0 comments on commit d968dda

Please sign in to comment.