tests/testthat/test-tbl_df.R

test_that("e_rows_update can update a row in a data.frame", {
      x <- mtcars
      x$id <- seq_len(nrow(x))
      y <- x[1,]
      y$mpg <- 1000
      
      result <- e_rows_update(x = x, y = y, by = "id")
      expect_equal(result[1,"mpg"][[1]], 1000)
    })

Try the editbl package in your browser

Any scripts or data that you put into this service are public.

editbl documentation built on April 3, 2025, 6:21 p.m.