struct: C-Style Structs Stored in Virtual Memory

View source: R/matter_list.R

structR Documentation

C-Style Structs Stored in Virtual Memory

Description

This is a convenience function for creating and reading C-style structs in a single file stored in virtual memory.

Usage

struct(..., path = NULL, readonly = FALSE, offset = 0, filename)

Arguments

...

Named integers giving the members of the struct. They should be of the form name=c(type=length).

path, filename

A single string giving the name of the file.

readonly

Should the file be treated as read-only?

offset

A scalar integer giving the offset from the beginning of the file.

Details

This is simply a convenient wrapper around the wrapper around matter_list that allows easy specification of C-style structs in a file.

Value

A object of class matter_list.

Author(s)

Kylie A. Bemis

See Also

matter_list

Examples

x <- struct(first=c(int=1), second=c(double=1))

x$first <- 2L
x$second <- 3.33

x$first
x$second

kuwisdelu/matter documentation built on Oct. 19, 2024, 10:31 a.m.