| Title: | HAR (GEMPACK) file read/write utility |
|---|---|
| Description: | This package reads/writes HAR files (and SL4 files) directly using basic R functions |
| Authors: | Maros Ivanic [aut, cre] |
| Maintainer: | Maros Ivanic <[email protected]> |
| License: | open |
| Version: | 1.1.0 |
| Built: | 2026-05-26 07:49:21 UTC |
| Source: | https://github.com/pfuehrlich-pik/HARr |
Reads in a GEMPACK HAR file and returns its representation a list. Currently can only process integer headers, real full headers and character headers
read_har( con, useCoefficientsAsNames = FALSE, toLowerCase = TRUE, headersToRead = NULL )read_har( con, useCoefficientsAsNames = FALSE, toLowerCase = TRUE, headersToRead = NULL )
useCoefficientsAsNames |
If a coefficient name is present in the header, use that instead of the four-letter header |
toLowerCase |
= TRUE Turn all strings to lower case |
headersToRead |
= NULL A vector of header names to read in |
filename |
Path to HAR file |
A list of headers
This function reads SL4 solution files into a list
read_SL4(filename, toLowerCase = TRUE)read_SL4(filename, toLowerCase = TRUE)
filename |
Path to SL4 file |
A list of variables
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)
write_har(data, filename, maxSize = 10000)write_har(data, filename, maxSize = 10000)
data |
A list |
myList = list(TEST = c('Test')) attr(myList$TEST,'description') = "This is the long header name" write_har(myList,'harfile.har')myList = list(TEST = c('Test')) attr(myList$TEST,'description') = "This is the long header name" write_har(myList,'harfile.har')