Learn R Programming

eplusr (version 0.9.4)

read_idf: Read an EnergyPlus Input Data File (IDF)

Description

read_idf takes an EnergyPlus Input Data File (IDF) as input and returns an Idf object. For more details on Idf object, please see Idf class.

Usage

read_idf(path, idd = NULL)

Arguments

path

Either a path, a connection, or literal data (either a single string or a raw vector) to an EnergyPlus Input Data File (IDF), usually has a extension .idf.

idd

Any acceptable input of use_idd(). If NULL, which is the default, the version of IDF will be passed to use_idd(). If the input IDF does not have a version field (possible for ".ddy" files), then it will be parsed using the latest version of IDD cached, with a warning.

Value

An Idf object.

Details

Currently, Imf file is not fully supported. All EpMacro lines will be treated as normal comments of the nearest downwards object. If input is an Imf file, a warning will be given during parsing. It is recommended to convert the Imf file to an Idf file and use ParametricJob class to conduct parametric analysis.

See Also

Idf class for modifying EnergyPlus model. use_idd() and download_idd() for downloading and parsing EnergyPlus IDD file. use_eplus() for configuring which version of EnergyPlus to use.

Examples

Run this code
# NOT RUN {
# example model shipped with eplusr from EnergyPlus v8.8
idf_path <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") # v8.8

# if neither EnergyPlus v8.8 nor Idd v8.8 was found, error will occur
is_avail_eplus(8.8)

is_avail_idd(8.8)

# }
# NOT RUN {
(read_idf(idf_path))
# }
# NOT RUN {
# if EnergyPlus v8.8 is found but Idd v8.8 was not, `Energy+.idd` in EnergyPlus
# installation folder will be used for pasing
is_avail_eplus(8.8)
is_avail_idd(8.8)

# }
# NOT RUN {
read_idf(idf_path)
# }
# NOT RUN {
# if Idd v8.8 is found, it will be used automatically
is_avail_idd(8.8)

# }
# NOT RUN {
read_idf(idf_path)
# }
# NOT RUN {
# argument `idd` can be specified explicitly using `use_idd()`
# }
# NOT RUN {
read_idf(idf_path, idd = use_idd(8.8))
# }
# NOT RUN {
# you can set `download` arugment to "auto" in `use_idd()` if you want to
# automatically download corresponding IDD file when necessary
read_idf(idf_path, use_idd(8.8, download = "auto"))

# Besides use a path to an IDF file, you can also provide IDF in literal
# string format
idf_string <-
    "
    Version, 8.8;
    Building,
        Building;                !- Name
    "

read_idf(idf_string, use_idd(8.8, download = "auto"))
# }

Run the code above in your browser using DataLab