diff --git a/R/compat-dplyr.R b/R/compat-dplyr.R index bbeb3c919..340810003 100644 --- a/R/compat-dplyr.R +++ b/R/compat-dplyr.R @@ -57,12 +57,3 @@ map_dfr <- function(.x, .f, ...) { res <- map(.x, .f, ...) vec_rbind(!!!res) } - -mutate <- function(.data, ...) { - collected <- list(...) - for (idx in seq_along(collected)) { - .data[names(collected)[idx]] <- unname(collected[[idx]]) - } - - .data -} diff --git a/tests/testthat/test-cache-low-level-api.R b/tests/testthat/test-cache-low-level-api.R index b5f29b342..f4b4694ea 100644 --- a/tests/testthat/test-cache-low-level-api.R +++ b/tests/testthat/test-cache-low-level-api.R @@ -1,16 +1,16 @@ test_that("caching utils make right blocks with semi-colon", { blocks_simple_uncached <- compute_parse_data_nested(c("1 + 1", "2; 1+1")) %>% - mutate(is_cached = FALSE) %>% + base::transform(is_cached = FALSE) %>% cache_find_block() expect_equal(blocks_simple_uncached, c(1, 1, 1, 1)) blocks_simple_cached <- compute_parse_data_nested(c("1 + 1", "2; 1+1")) %>% - mutate(is_cached = TRUE) %>% + base::transform(is_cached = TRUE) %>% cache_find_block() expect_equal(blocks_simple_cached, c(1, 1, 1, 1)) blocks_edge <- compute_parse_data_nested(c("1 + 1", "2; 1+1")) %>% - mutate(is_cached = c(TRUE, TRUE, FALSE, FALSE)) %>% + base::transform(is_cached = c(TRUE, TRUE, FALSE, FALSE)) %>% cache_find_block() expect_equal(blocks_edge, c(1, 2, 2, 2)) }) @@ -30,7 +30,7 @@ test_that("caching utils make right blocks with comments", { blocks_simple_uncached <- compute_parse_data_nested(text) %>% - mutate(is_cached = c( + base::transform(is_cached = c( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE )) %>% @@ -48,7 +48,7 @@ test_that("caching utils make right blocks with comments", { tau1 = 1 # here? " blocks_simple_cached <- compute_parse_data_nested(text) %>% - mutate(is_cached = c( + base::transform(is_cached = c( FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE )) %>% cache_find_block() @@ -101,17 +101,17 @@ test_that("blank lines are correctly identified", { test_that("caching utils make right blocks with comments", { blocks_simple_uncached <- compute_parse_data_nested(c("1 + 1", "2 # comment")) %>% - mutate(is_cached = FALSE) %>% + base::transform(is_cached = FALSE) %>% cache_find_block() expect_equal(blocks_simple_uncached, c(1, 1, 1)) blocks_simple_cached <- compute_parse_data_nested(c("1 + 1", "2 # comment2")) %>% - mutate(is_cached = TRUE) %>% + base::transform(is_cached = TRUE) %>% cache_find_block() expect_equal(blocks_simple_cached, c(1, 1, 1)) blocks_edge <- compute_parse_data_nested(c("1 + 1", "2 # 1+1")) %>% - mutate(is_cached = c(TRUE, TRUE, FALSE)) %>% + base::transform(is_cached = c(TRUE, TRUE, FALSE)) %>% cache_find_block() expect_equal(blocks_edge, c(1, 2, 2)) })