Learn R Programming

lpjmlkit (version 1.0.11)

as_header: Coerce LPJmLMetaData to an LPJmL header object

Description

Function to coerce (convert) an LPJmLMetaData object into an LPJmL header object. More information at create_header().

Usage

as_header(x, silent = FALSE)

Value

An LPJmL header object. More information at create_header().

Arguments

x

An LPJmLMetaData object

silent

Logical. Whether to suppress notifications from header conversion/initialization.

Examples

Run this code
if (FALSE) {

vegc_meta <- read_meta(filename = "./vegc.bin.json")

# Returns a list object with the structure of an LPJmL header
as_header(vegc_meta)
# $name
# [1] "LPJDUMMY"
#
# $header
#      version        order    firstyear        nyear    firstcell
#          4.0          4.0       1901.0        200.0          0.0
#        ncell       nbands cellsize_lon       scalar cellsize_lat
#      67420.0          1.0          0.5          1.0          0.5
#     datatype        nstep     timestep
#          3.0          1.0          1.0
#
# $endian
# [1] "little"

}

Run the code above in your browser using DataLab