tests/testthat/test_format_fortran.R

context("Fortran imports/exports")

test_that("Import from Fortran", {
    ff <- tempfile()
    cat(file = ff, "123456", "987654", sep = "\n")
    expect_true(inherits(import(ff, format = "fortran", style = c("F2.1","F2.0","I2")), "data.frame"))
    unlink(ff)
})

Try the rio package in your browser

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

rio documentation built on Sept. 19, 2023, 5:06 p.m.