tests/testthat/test_format_matlab.R

context("rmatio imports/exports")
require("datasets")

test_that("Export to matlab", {
    skip("failing mysteriously")
    # skip_if_not_installed(pkg="rmatio")
    expect_true(export(iris, "iris.matlab") %in% dir())
})

test_that("Import from matlab", {
    skip("failing mysteriously")
    # skip_if_not_installed(pkg="rmatio")
    expect_true(is.data.frame(import("iris.matlab")))
    expect_true(identical(dim(import("iris.matlab")), dim(iris)))
})
unlink("iris.matlab")

Try the rio package in your browser

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

rio documentation built on Nov. 22, 2021, 9:07 a.m.