struct: C-Style Structs Stored in Virtual Memory

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/matter_list.R

Description

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

Usage

1
struct(..., filename = NULL, filemode = "rw", offset = 0)

Arguments

...

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

filename

A single string giving the name of the file.

filemode

The mode to use to open the file.

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

1
2
3
4
5
6
7
x <- struct(first=c(int=1), second=c(double=1))

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

x$first
x$second

matter documentation built on Nov. 8, 2020, 6:15 p.m.