tests/testthat/test_w.R

test_that("w works as expected", {
    
    # Write a file.
    w( cars, paste0( tempdir(), '/cars' ) )

    # Read the file and delete it.
    t = read.csv( paste0( tempdir(), '/cars.csv' ) )
    file.remove( paste0( tempdir(), '/cars.csv' ) )

    # Verify it is as expected.
    expect_equal( t, cars )
    
})

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.