
Last chance! 50% off unlimited learning
Sale ends in
readAsRaw
takes a connection or file name and reads it into
a raw type.
readAsRaw(con, n, nmax, fileEncoding="")
readAsRaw
returns a raw
type which can then be consumed
by functions like mstrsplit
and dstrsplit
.
A connection object or a character string naming a file from which to save the output.
Expected number of bytes to read. Set to 65536L
by
default when con
is a connection, and set to the file size
by default when con
is a character string.
Maximum number of bytes to read; missing of Inf
to read in the entire connection.
When con
is a connection, the file encoding
to use to open the connection.
Taylor Arnold
mm <- model.matrix(~., iris)
f <- file("iris_mm.io", "wb")
writeBin(as.output(mm), f)
close(f)
m <- mstrsplit(readAsRaw("iris_mm.io"), type="numeric", nsep="\t")
head(mm)
head(m)
unlink("iris_mm.io")
Run the code above in your browser using DataLab