transition {eplusr}R Documentation

Perform version transition of EnergyPlus model

Description

transition() takes an Idf object or a path of IDF file and a target version, performs version transitions and returns an Idf object of specified version.

Usage

transition(idf, ver, keep_all = FALSE, save = FALSE, dir = NULL)

Arguments

idf

An Idf object or a path of IDF file.

ver

A valid EnergyPlus IDD version, e.g. "9", "8.8", or "8.8.0".

keep_all

If TRUE, a list will be return which contains all Idf objects of intermediate versions. The list will be named using first two number of that version, e.g. 8.1, 8.2. If FALSE, only the Idf object of the version specified by ver will be returned. Default: FALSE.

save

If TRUE, the models will be saved into specified directory. Default: FALSE.

dir

Only applicable when save is TRUE. The directory to save the new IDF files. If the directory does not exist, it will be created before save. If NULL, the directory of input Idf object or IDF file will be used. Default: NULL.

Value

An Idf object if keep_all is FALSE or a list of Idf objects if keep_all is TRUE.

Author(s)

Hongyuan Jia

See Also

See version_updater() which directly call EnergyPlus preprocessor IDFVersionUpdater to perform the version transitions.

Examples

## Not run: 
if (any(avail_eplus()) > "7.2") {
    # create an empty IDF
    idf <- empty_idf("7.2")

    # convert it from v7.2 to the latest EnergyPlus installed
    transition(idf, max(avail_eplus()))

    # convert it from v7.2 to the latest EnergyPlus installed and keep all
    # intermediate versions
    transition(idf, max(avail_eplus()), keep_all = TRUE)

    # convert it from v7.2 to the latest EnergyPlus installed and keep all
    # intermediate versions and save all them
    idf$save(tempfile(fileext = ".idf"))
    transition(idf, max(avail_eplus()), keep_all = TRUE,
        save = TRUE, dir = tempdir()
    )
}

## End(Not run)

[Package eplusr version 0.16.2 Index]