tests/testthat/test_format_fortran.R

test_that("Import from Fortran", {
    ## no fixed file extension
    withr::with_tempfile("fortran_file", code = {
        cat(file = fortran_file, "123456", "987654", sep = "\n")
        expect_true(is.data.frame(import(fortran_file, format = "fortran", style = c("F2.1","F2.0","I2"))))
    })
})

Try the rio package in your browser

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

rio documentation built on May 29, 2024, 10:11 a.m.