inst/tinytest/test-statistics.R

set_no_print(TRUE)

test_df <- data.frame(var1 = 1:5,
                      var2 = c(6, 7, 8, NA, 10),
                      var3 = 11:15)

# Row wise calculation
result <- test_df |> row_calculation("sum",  var1, var2, var3)

expect_equal(result, c(18, 21, 24, 18, 30), info = "Row wise calculation")


set_no_print()

Try the qol package in your browser

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

qol documentation built on June 17, 2026, 1:07 a.m.