Learn R Programming

HARr (version 1.1.0)

write_har: 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)

Value

No return value, called for side effects

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

Examples

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

Run the code above in your browser using DataLab