Skip to contents

Write elements to a BinaryWriter object.

Usage

# S4 method for class 'BinaryWriter,numeric'
write_elements(x, els)

Arguments

x

Object of class BinaryWriter

els

Numeric vector of elements to write

Examples

# \donttest{
# Create a temporary binary file for writing
tmp <- tempfile()
writer <- BinaryWriter(tmp, byte_offset = 0L,
                      data_type = "DOUBLE", bytes_per_element = 8L)
# Write some data
write_elements(writer, rnorm(100))
close(writer)

# Clean up
unlink(tmp)
# }