tests/testthat/test_tcol.R

test_that( "works as expected", {
  
  x = dplyr::summarize_at( dplyr::group_by( iris, Species ), dplyr::vars( Sepal.Length, Sepal.Width ), list(sum) )
  tx = tcol( x, 'Species' )
  expect_equal( tx$col, c( 'Sepal.Length', 'Sepal.Width' ) )
  expect_equal( tx$setosa, c( 250.3, 171.4 ) )

})

Try the easyr package in your browser

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

easyr documentation built on March 31, 2023, 6:22 p.m.