Package 'HARr'

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: 2024-08-21 02:28:23 UTC
Source: https://github.com/pfuehrlich-pik/HARr

Help Index


Read a GEMPACK HAR file into R

Description

Reads in a GEMPACK HAR file and returns its representation a list. Currently can only process integer headers, real full headers and character headers

Usage

read_har(con, useCoefficientsAsNames = FALSE, toLowerCase = TRUE)

Arguments

useCoefficientsAsNames

If a coefficient name is present in the header, use that instead of the four-letter header

filename

Path to HAR file

Value

A list of headers


Read an SL4 solution file

Description

This function reads SL4 solution files into a list

Usage

read_SL4(filename, toLowerCase = TRUE)

Arguments

filename

Path to SL4 file

Value

A list of variables


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

Examples

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