write_har: Write an R list to GEMPACK HAR

View source: R/write_har.R

write_harR Documentation

Write an R list to GEMPACK HAR

Description

This function writes a HAR file based on a list. If a list element contains attribute "description," then it is used to define the long header name

Some warnings: (1) you cannot have NA's in a HAR file, (2) empty strings are not allowed, (3) some programs (e.g., GEMPACK models) read chunks of data no longer than 1e4 bytes (set maxSize = 1e4), (4) all dimensions in arrays must have names (see example)

Usage

write_har(data, filename, maxSize = 10000)

Arguments

data

A list

filename

Path to the file to be created

maxSize

Maximum size of data chunk in real array, default of 10,000

Value

No return value, called for side effects

Examples

myList = list(TEST = c('Test'))
attr(myList$TEST,'description') = "This is the long header name"
write_har(myList,'harfile.har')
file.remove('harfile.har')

HARr documentation built on Aug. 27, 2025, 5:11 p.m.