tests/readMat,noattach.R

path <- system.file("mat-files", package = "R.matlab")
data <- R.matlab::readMat(file.path(path, "unsignedByte.mat"))
if (!identical(as.vector(data$A), as.double(126:255)))
  stop("Error reading unsigned bytes saved by MATLAB.")

# Also, assert that...
cons0 <- getAllConnections()

# Compressed data blocks - display raw bytes
pathname <- file.path(path, "NestedMiMATRIX,problem4,v5,compressed.mat")
data <- R.matlab::readMat(pathname, verbose = -120)

# ...no connections are left open
stopifnot(identical(getAllConnections(), cons0))

Try the R.matlab package in your browser

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

R.matlab documentation built on Aug. 26, 2022, 1:07 a.m.