IdfObject is an abstraction of a single object in an Idf. It provides more detail methods to modify object values and comments. An IdfObject object can also be created using function idf_object() or from methods of a parent Idf object, using $object(), $objects_in_class() and equivalent.

Note

  • Only one single list is allowed, e.g. idfobj$set(lst1) where lst1 <- list(field1 = value1) is allowed, but idfobj$set(lst1, lst2) is not.

  • You can delete a field by assigning NULL to it, e.g. iddobj$set(fld = NULL) means to delete the value of field fld. If .default is FALSE, also fld is not a required field and the index of fld is larger than the number minimum fields required for that class, it will be deleted. Otherwise it will be left as blank. If .default is TRUE, that field will be filled with default value if applicable and left as blank if not.

  • By default, trailing empty fields that are not required will be removed and only minimum required fields are kept. You can keep the trailing empty fields by setting .empty to TRUE.

  • New fields that currently do not exist in that object can also be set. They will be automatically added on the fly.

  • Field name matching is case-insensitive. For convenience, underscore-style field names are also allowed, e.g. eNd_MoNtH is equivalent to End Month.

  • If not all field names are given, positions of those values without field names are determined after those values with names. E.g. in model$set(Construction = list("out_layer", name = "name")), "out_layer" will be treated as the value of field Outside Layer in Construction, as value of field Name has been given as "name".

eplusr also provides custom S3 method of $<- and [[<- which makes it more convenient to set a single field value of an IdfObject. Basically, idfobj$FieldName <- value and idfobj[[Field]] <- value is equivalent to idfobj$set(FieldName = value) and idfobjset(Field = value).

See also

Idf class

Methods

Public methods


Method new()

Create an IdfObject object

Usage

IdfObject$new(object, class = NULL, parent)

Arguments

object

An integer specifying an object ID.

class

An integer specifying a class index.

parent

An Idf object specifying the parent object.

Details

It is not recommended to directly use $new() method to create an IdfObject object, instead considering to use idf_object, Idf$object() and other equivalent to create IdfObject objects. They provide more user-friendly interfaces. $new() is a lower level API which is mainly used inside methods in other classes.

Returns

An IdfObject object.

Examples

\dontrun{
# example model shipped with eplusr from EnergyPlus v8.8
path_idf <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") # v8.8
idf <- read_idf(path_idf, use_idd(8.8, "auto"))

roof <- IdfObject$new(26, parent = idf)

# get the IdfObject of material named "C5 - 4 IN HW CONCRETE"
mat <- idf$Material[["C5 - 4 IN HW CONCRETE"]]
}


Method version()

Get the version of parent Idf

Usage

IdfObject$version()

Details

$version() returns the version of parent Idf in a base::numeric_version() format. This makes it easy to direction compare versions of different IdfObjects, e.g. idfobj$version() > 8.6 or idfobj1$version() > idfobj2$version().

Returns

A base::numeric_version() object.

Examples

\dontrun{
# get version
roof$version()
}


Method parent()

Get parent Idf

Usage

IdfObject$parent()

Details

$parent() returns parent Idf object.

Returns

A Idf object.

Examples

\dontrun{
roof$parent()
}


Method id()

Get the unique ID for current object

Usage

IdfObject$id()

Details

In Idf, each object is assigned with an integer as an universally unique identifier (UUID) in the context of current Idf. UUID is not reused even if the object associated is deleted.

$id() returns an integer of current object unique ID.

Returns

A single integer.

Examples

\dontrun{
roof$id()
}


Method name()

Get the name for current object.

Usage

IdfObject$name()

Details

In Idf, each object is assigned with a single string as the name for it, if the class it belongs to has name attribute, e.g. class RunPeriod, Material and etc. That name should be unique among all objects in that class. EnergyPlus will fail with an error if duplications are found among object names in a class.

$name() returns a single string of current object name. If specified class does not have name attribute, NA is returned.

Returns

A single string.

Examples

\dontrun{
roof$name()

# NA will be returned if the class does not have name attribute. For example,
# "Version" class
idf$Version$name()
}


Method group_name()

Get name of group for current object.

Usage

IdfObject$group_name()

Details

$group_name() returns a single string of group name current IdfObject belongs to.

Returns

A single string.

Examples

\dontrun{
roof$group_name()
}


Method class_name()

Get name of class for current object.

Usage

IdfObject$class_name()

Details

$class_name() returns a single string of class name current IdfObject belongs to.

Returns

A single string.

Examples

\dontrun{
roof$class_name()
}


Method definition()

Get the IddObject object for current class.

Usage

IdfObject$definition()

Details

$definition() returns an IddObject of current class. IddObject contains all data used for parsing and creating current IdfObject. For details, please see IddObject class.

Returns

An IddObject object.

Examples

\dontrun{
roof$definition()
}


Method comment()

Get and modify object comments

Usage

IdfObject$comment(comment, append = TRUE, width = 0L)

Arguments

comment

A character vector.

  • If missing, current comments are returned. If there is no comment in current IdfObject, NULL is returned.

  • If NULL, all comments in current IdfObject is deleted.

  • If a character vector, it is inserted as comments depending on the append value.

append

Only applicable when commment is a character vector. Default: FALSE.

  • If NULL, existing comments is deleted before adding comment.

  • If TRUE, comment will be appended to existing comments.

  • If FALSE, comment is prepended to existing currents.

width

A positive integer giving the target width for wrapping inserted comment.

Details

$comment() returns current IdfObject comments if comment is not given, or modifies current IdfObject comments if comment is given. If no comments found, NULL is returned.

Returns

If calling without any argument, a character vector or NULL (if no comments) is return. Otherwise, the modified object itself.

Examples

\dontrun{
# get object comments
roof$comment()

# add new object comments
roof$comment(c("This is a material named `WD01`", "This object has an ID of 47"))
roof$comment()

# append new comments
roof$comment("This is an appended comment")
roof$comment()

# prepend new comments
roof$comment("This is a prepended comment", append = FALSE)
roof$comment()

# wrap long comments
roof$comment("This is a very long comment that is needed to be wrapped.", width = 30)
roof$comment()

# delete old comments and add new one
roof$comment("This is the only comment", append = NULL)
roof$comment()

# delete all comments
roof$comment(NULL)
roof$comment()
}


Method value()

Get object field values.

Usage

IdfObject$value(which = NULL, all = FALSE, simplify = FALSE, unit = FALSE)

Arguments

which

An integer vector of field indexes or a character vector of field names.

all

If TRUE, values of all possible fields in current class the IdfObject belongs to are returned. Default: FALSE

simplify

If TRUE, values of fields are converted into characters and the converted character vector is returned.

unit

If TRUE, values of numeric fields are assigned with units using units::set_units() if applicable. Default: FALSE.

Details

$value() takes an integer vector of valid field indexes or a character vector of valid field names, and returns a named list containing values of specified fields when simplify is FALSE and a character vector when simplify is TRUE.

eplusr also provides custom S3 method of $ and [[ which make it more convenient to get a single value of current IdfObject. Basically, idfobj$FieldName and idfobj[[Field]] is equivalent to idfobj$value(FieldName)[[1]] and idfobj$value(Field)[[1]].

Returns

A named list.

Examples

\dontrun{
# get all existing field values
str(mat$value())

# get values of field 1, 3, 5
str(mat$value(c(1, 3, 5)))

# get character format values instead of a named list
mat$value(c(1, 3, 5), simplify = TRUE)

# get values of all field even those that are not set
str(roof$value())
str(roof$value(all = TRUE))

# get field values using shortcuts
mat$Roughness
mat[["Specific_Heat"]]
mat[c(1,2)]
mat[c("Name", "Density")]
}


Method set()

Modify object field values.

Usage

IdfObject$set(..., .default = TRUE, .empty = FALSE)

Arguments

...

New field value definitions in field = value format or a single list in format:

list(field1 = value1, field2 = value2)

.default

If TRUE, default values are used for those blank fields if possible. Default: TRUE.

.empty

If TRUE, trailing empty fields are kept. Default: FALSE.

Details

$set() takes new field value definitions in field = value format or in a single list format, sets new values for fields specified, and returns the modified IdfObject. Unlike $set() method in Idf class, the special element .comment is not allowed. To modify object comments, please use $comment().

Examples

\dontrun{
# set field values
mat$set(name = "new_name", Thickness = 0.02)
mat[c("Name", "Thickness")]

# When `default` argument is set to TRUE and input field values are empty, i.e.
# NULL, the field values will be reset to defaults.
mat[c("Thermal Absorptance", "Solar Absorptance")]

mat$set(visible_absorptance = NULL, Solar_Absorptance = NULL, .default = TRUE)
mat[c("Visible Absorptance", "Solar Absorptance")]

# set field values using shortcuts
mat$Name <- "another_name"
mat$Name
mat[["Thickness"]] <- 0.019
mat$Thickness
}


Method value_possible()

Get possible object field values.

Usage

IdfObject$value_possible(
  which = NULL,
  type = c("auto", "default", "choice", "range", "source")
)

Arguments

which

An integer vector of field indexes or a character vector of field names.

type

A character vector. What types of possible values should be returned. Should be one of or a combination of "auto", "default", "choice", "range" and "source". Default: All of those.

Details

$value_possible() takes an integer vector of valid field indexes or a character vector of valid field names, and returns all possible values for specified fields. For a specific field, there are 5 types of possible values:

  • auto: Whether the field can be filled with Autosize and Autocalculate. This field attribute can also be retrieved using:

    idfobj$definition()$is_autosizable_field()
    idfobj$definition()$is_autocalculatable_field()
    
  • default: The default value. This value can also be retrieved using idfobj$defintion()$field_default().

  • choice: The choices which the field can be set. This value can also be retrieved using idfobj$definition()$field_choice().

  • range: The range which the field value should fall in. This range can also be retrieved using idfobj$definition()$field_range().

  • source: All values from other objects that current field can refer to.

Returns

$value_possible() returns an IdfValuePossible object which is a data.table with at most 15 columns:

  • class_id: index of class that current IdfObject belongs to

  • class_name: name of class that current IdfObject belongs to

  • object_id: ID of current IdfObject

  • object_name: name of current IdfObject

  • field_id: indexes (at Idd level) of object fields specified

  • field_index: indexes of object fields specified

  • field_name: names (without units) of object fields specified

  • value_id: value indexes (at Idf level) of object fields specified

  • value_chr: values (converted to characters) of object fields specified

  • value_num: values (converted to numbers in SI units) of object fields specified.

  • auto: Exists only when "auto" is one of type. Character type. Possible values are: "Autosize", "Autocalculate" and NA (if current field is neither autosizable nor autocalculatable).

  • default: Exists only when "default" is one of type. List type. The default value of current field. The value is converted into number if corresponding field type yells so. Note that if current field is a numeric field but the default value is "Autosize" or "Autocalculate", it is left as it is, leaving the returned type being a string instead of a number.

  • range: Exists only when "range" is one of type. List type. The range that field value should fall in. Every range has four components: minimum (lower limit), lower_incbounds (TRUE if the lower limit should be included), maximum (upper limit), and upper_incbounds (TRUE if the upper limit should be included). For fields of character type, empty lists are returned. For fields of numeric types with no specified ranges, minimum is set to -Inf, lower_incbounds is set to FALSE, upper is set to Inf, and upper_incbounds is set to FALSE. The field range is printed in number interval denotation.

  • source: Exists only when "source" is one of type. List type. Each element is a character vector which includes all values from other objects that current field can use as sources and refers to.

Examples

\dontrun{
mat$value_possible()
}


Method validate()

Check possible object field value errors

Usage

IdfObject$validate(level = eplusr_option("validate_level"))

Arguments

level

One of "none", "draft", "final" or a list of 10 elements with same format as custom_validate() output.

Details

$validate() checks if there are errors in current IdfObject object under specified validation level and returns an IdfValidity object.

$validate() is useful to help avoid some common errors before running the model. By default, validation is performed when calling all methods that modify objects, e.g. $set() and etc.

In total, there are 10 different validate checking components:

  • required_object: Check if required objects are missing in current Idf.

  • unique_object: Check if there are multiple objects in one unique-object class. An unique-object class means that there should be at most only one object existing in that class.

  • unique_name: Check if all objects in each class have unique names.

  • extensible: Check if all fields in an extensible group have values. An extensible group is a set of fields that should be treated as a whole, such like the X, Y and Z vertices of a building surfaces. An extensible group should be added or deleted together. extensible component checks if there are some, but not all, fields in an extensible group are empty.

  • required_field: Check if all required fields have values.

  • auto_field: Check if all fields filled with value "Autosize" and "Autocalculate" are actual autosizable and autocalculatable fields or not.

  • type: Check if all fields have value types complied with their definitions, i.e. character, numeric and integer fields should be filled with corresponding type of values.

  • choice: Check if all choice fields are filled with valid choice values.

  • range: Check if all numeric fields have values within prescibed ranges.

  • reference: Check if all fields whose values refer to other fields are valid.

The level argument controls what checkings should be performed. level here is just a list of 10 element which specify the toggle status of each component. You can use helper custom_validate() to get that list and pass it directly to level.

There are 3 predefined validate level that indicates different combinations of checking components, i.e. none, draft and final. Basically, none level just does not perform any checkings; draft includes 5 components, i.e. auto_field, type, unique_name, choice and range; and final level includes all 10 components. You can always get what components each level contains using level_checks(). By default, the result from eplusr_option("validate_level") is passed to level. If not set, final level is used.

Underneath, an IdfValidity object which $validate() returns is a list of 13 element as shown below. Each element or several elements represents the results from a single validation checking component.

  • missing_object: Result of required_object checking.

  • duplicate_object: Result of unique_object checking.

  • conflict_name: Result of unique_name checking.

  • incomplete_extensible: Result of extensible checking.

  • missing_value: Result of required_field checking.

  • invalid_autosize: Result of auto_field checking for invalid Autosize field values.

  • invalid_autocalculate: Result of auto_field checking for invalid Autocalculate field values.

  • invalid_character: Result of type checking for invalid character field values.

  • invalid_numeric: Result of type checking for invalid numeric field values.

  • invalid_integer: Result of type checking for invalid integer field values.

  • invalid_choice: Result of choice checking.

  • invalid_range: Result of range checking.

  • invalid_reference: Result of reference checking.

Except missing_object, which is a character vector of class names that are missing, all other elements are data.table with 9 columns containing data of invalid field values:

  • object_id: IDs of objects that contain invalid values

  • object_name: names of objects that contain invalid values

  • class_id: indexes of classes that invalid objects belong to

  • class_name: names of classes that invalid objects belong to

  • field_id: indexes (at Idd level) of object fields that are invalid

  • field_index: indexes of object fields in corresponding that are invalid

  • field_name: names (without units) of object fields that are invalid

  • units: SI units of object fields that are invalid

  • ip_units: IP units of object fields that are invalid

  • type_enum: An integer vector indicates types of invalid fields

  • value_id: indexes (at Idf level) of object field values that are invalid

  • value_chr: values (converted to characters) of object fields that are invalid

  • value_num: values (converted to numbers in SI units) of object fields that are invalid

Knowing the internal structure of IdfValidity, it is easy to extract invalid IdfObjects you interested in. For example, you can get all IDs of objects that contain invalid value references using model$validate()$invalid_reference$object_id. Then using $set() method to correct them.

Different validate result examples are shown below:

  • No error is found:

    v No error found.
    

    Above result shows that there is no error found after conducting all validate checks in specified validate level.

  • Errors are found:

     x [2] Errors found during validation.
    =========================================================================
    
    -- [2] Invalid Autocalculate Field --------------------------------------
       Fields below cannot be `autocalculate`:
    
        Class: <AirTerminal:SingleDuct:VAV:Reheat>
        \- Object [ID:176] <SPACE5-1 VAV Reheat>
           +- 17: AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2}
           \- 18: AUTOCALCULATE; !- Maximum Flow Fraction During Reheat
    

    Above result shows that after all validate components performed under current validate level, 2 invalid field values are found. All of them are in a object named SPACE5-1 VAV Reheat with ID 176. They are invalid because those two fields do not have an autocalculatable attribute but are given AUTOCALCULATE value. Knowing this info, one simple way to fix the error is to correct those two fields by doing:

    idf$set(..176 =
        list(`Maximum Flow per Zone Floor Area During Reheat` = "autosize",
             `Maximum Flow Fraction During Reheat` = "autosize"
        )
    )
    

Returns

An IdfValidity object.

Examples

\dontrun{
mat$validate()

# check at predefined validate level
mat$validate("none")
mat$validate("draft")
mat$validate("final")

# custom validate checking components
mat$validate(custom_validate(auto_field = TRUE, choice = TRUE))
}


Method is_valid()

Check if there is any error in current object

Usage

IdfObject$is_valid(level = eplusr_option("validate_level"))

Arguments

level

One of "none", "draft", "final" or a list of 10 elements with same format as custom_validate() output.

Details

$is_valid() returns TRUE if there is no error in current IdfObject object under specified validation level and FALSE otherwise.

$is_valid() checks if there are errors in current IdfObject object under specified validation level and returns TRUE or FALSE accordingly. For detailed description on validate checking, see $validate() documentation above.

Returns

A single logical value of TRUE or FALSE.

Examples

\dontrun{
mat$is_valid()

mat$definition()$field_range("Density")
eplusr_option(validate_level = "none") # have to set validate to "none" to do so
mat$Density <- -1
eplusr_option(validate_level = "final") # change back to "final" validate level
mat$is_valid()

# check at predefined validate level
mat$is_valid("none")
mat$is_valid("draft")
mat$is_valid("final")

# custom validate checking components
mat$is_valid(custom_validate(auto_field = TRUE, choice = TRUE))
}


Method value_relation()

Get value relations

Usage

IdfObject$value_relation(
  which = NULL,
  direction = c("all", "ref_to", "ref_by", "node"),
  recursive = FALSE,
  depth = 1L
)

Arguments

which

An integer vector of field indexes or a character vector of field names.

direction

The relation direction to extract. Should be either "all", "ref_to" or "ref_by".

recursive

If TRUE, the relation is searched recursively. A simple example of recursive reference: one material named mat is referred by a construction named const, and const is also referred by a surface named surf.

depth

Only applicable when recursive is TRUE. This is a depth to when searching value relations recursively. If NULL, all recursive relations are returned. Default: 1.

class

A character vector of class names.

Details

Many fields in Idd can be referred by others. For example, the Outside Layer and other fields in Construction class refer to the Name field in Material class and other material related classes. Here it means that the Outside Layer field refers to the Name field and the Name field is referred by the Outside Layer. In EnergyPlus, there is also a special type of field called Node, which together with Branch and BranchList define the topography of the HVAC connections. A outlet node of a component can be referred by another component as its inlet node, but can also exists independently, such as zone air node.

$value_relation() provides a simple interface to get this kind of relation. It takes field indexes or field names, together a relation direction, and returns an IdfRelation object which contains data presenting such relation described above. For instance, if idfobj$value_relation("Name", "ref_by") gives results below:

-- Referred by Others ------------------------
  \- 1: "WALL-1";      !- Name
     ^~~~~~~~~~~~~~~~~~~~~~~~~
     \- Class: <BuildingSurface:Detailed>
        \- Object [ID:3] <WALL-1PF>
           \- 3: "WALL-1";      !- Construction Name

This means that the value "WALL-1" of field Name is referred by field Construction Name in a surface named WALL-1PF. All those objects can be further easily extracted using $ref_by_object() method.

Note that $value_relation() shows all fields specified, even some of them may do not have relation.

Returns

An IdfRelation object, which is a list of 3 data.table::data.table()s named ref_to, ref_by and node. Each data.table::data.table() contains 24 columns.

Examples

\dontrun{
# check each layer's reference of a construction named FLOOR
roof$value_relation("zone name", "ref_to")

# check where is this construction being used
roof$value_relation("name", direction = "ref_by")
}


Method ref_to_object()

Extract multiple IdfObject objects referred by specified field values

Usage

IdfObject$ref_to_object(
  which = NULL,
  class = NULL,
  recursive = FALSE,
  depth = 1L
)

Arguments

which

An integer vector of field indexes or a character vector of field names.

class

A character vector of class names.

recursive

If TRUE, the relation is searched recursively. A simple example of recursive reference: one material named mat is referred by a construction named const, and const is also referred by a surface named surf.

depth

Only applicable when recursive is TRUE. This is a depth to when searching value relations recursively. If NULL, all recursive relations are returned. Default: 1.

Details

For details on field value relations, see $value_relation().

$ref_to_object() takes an integer vector of field indexes or a character vector of field names, and returns a list of IdfObjects that specified fields refer to.

Returns

A named list of IdfObject objects.

Examples

\dontrun{
# get other objects that this object refereces
mat$ref_to_object() # not referencing other objects
}


Method ref_by_object()

Extract multiple IdfObject objects referring to specified field values

Usage

IdfObject$ref_by_object(
  which = NULL,
  class = NULL,
  recursive = FALSE,
  depth = 1L
)

Arguments

which

An integer vector of field indexes or a character vector of field names.

class

A character vector of class names.

recursive

If TRUE, the relation is searched recursively. A simple example of recursive reference: one material named mat is referred by a construction named const, and const is also referred by a surface named surf.

depth

Only applicable when recursive is TRUE. This is a depth to when searching value relations recursively. If NULL, all recursive relations are returned. Default: 1.

Details

For details on field value relations, see $value_relation().

$ref_by_object() takes an integer vector of field indexes or a character vector of field names, and returns a list of IdfObjects that refer to specified fields.

Returns

A named list of IdfObject objects.

Examples

\dontrun{
# get other objects that reference this object
mat$ref_by_object() # referenced by construction "FLOOR"
}


Method ref_to_node()

Extract multiple IdfObject objects referring to same nodes

Usage

IdfObject$ref_to_node(
  which = NULL,
  class = NULL,
  recursive = FALSE,
  depth = 1L
)

Arguments

which

An integer vector of field indexes or a character vector of field names.

class

A character vector of class names.

recursive

If TRUE, the relation is searched recursively. A simple example of recursive reference: one material named mat is referred by a construction named const, and const is also referred by a surface named surf.

depth

Only applicable when recursive is TRUE. This is a depth to when searching value relations recursively. If NULL, all recursive relations are returned. Default: 1.

Details

For details on field value relations, see $value_relation().

$ref_to_node() takes an integer vector of field indexes or a character vector of field names, and returns a list of IdfObjects whose nodes are referred by specified fields.

Returns

A named list of IdfObject objects.

Examples

\dontrun{
if (is_avail_eplus(8.8)) {
    path <- file.path(eplus_config(8.8)$dir, "ExampleFiles/5Zone_Transformer.idf")
    idf_5z <- read_idf(path)
    idf_5z$NodeList$OutsideAirInletNodes$ref_to_node()
}
}


Method has_ref_to()

Check if object field values refer to others

Usage

IdfObject$has_ref_to(which = NULL, class = NULL)

Arguments

which

An integer vector of field indexes or a character vector of field names.

class

A character vector of class names.

Details

For details on field value relations, see $value_relation().

$has_ref_to() takes an integer vector of field indexes or a character vector of field names, and returns a logical vector showing whether specified fields refer to other object values or not.

Returns

A logical vector with the same length as specified field.

Examples

\dontrun{
mat$has_ref_to()
}


Method has_ref_by()

Check if object field values are referred by others

Usage

IdfObject$has_ref_by(which = NULL, class = NULL)

Arguments

which

An integer vector of field indexes or a character vector of field names.

class

A character vector of class names.

Details

For details on field value relations, see $value_relation().

$has_ref_by() takes an integer vector of field indexes or a character vector of field names, and returns a logical vector showing whether there are other object values ref to specified fields.

Returns

A logical vector with the same length as specified field.

Examples

\dontrun{
mat$has_ref_by()
}


Method has_ref_node()

Check if object field values refer to other nodes

Usage

IdfObject$has_ref_node(which = NULL, class = NULL)

Arguments

which

An integer vector of field indexes or a character vector of field names.

class

A character vector of class names.

Details

For details on field value relations, see $value_relation().

$has_ref_node() takes an integer vector of field indexes or a character vector of field names, and returns a logical vector showing whether specified fields refer to other objects' nodes.

Returns

A logical vector with the same length as specified field.

Examples

\dontrun{
mat$has_ref_node()
}


Method has_ref()

Check if object field values refer to or are referred by others

Usage

IdfObject$has_ref(which = NULL)

Arguments

which

An integer vector of field indexes or a character vector of field names.

Details

For details on field value relations, see $value_relation().

$has_ref() takes an integer vector of field indexes or a character vector of field names, and returns a logical vector showing whether there are other object values ref to specified field values or specified field values refer to other object values or specified field values refer to other objects' nodes.

Returns

A logical vector with the same length as specified field.

Examples

\dontrun{
# check if having any referenced objects or is referenced by other objects
mat$has_ref()
}


Method to_table()

Format IdfObject as a data.frame

Usage

IdfObject$to_table(
  string_value = TRUE,
  unit = TRUE,
  wide = FALSE,
  all = FALSE,
  group_ext = c("none", "group", "index")
)

Arguments

string_value

If TRUE, all field values are returned as character. If FALSE, value column in returned data.table is a list column with each value stored as corresponding type. Note that if the value of numeric field is set to "Autosize" or "Autocalculate", it is left as it is, leaving the returned type being a string instead of a number. Default: TRUE.

unit

Only applicable when string_value is FALSE. If TRUE, values of numeric fields are assigned with units using units::set_units() if applicable. Default: FALSE.

wide

Only applicable if target objects belong to a same class. If TRUE, a wide table will be returned, i.e. first three columns are always id, name and class, and then every field in a separate column. Note that this requires all objects specified must from the same class. Default: FALSE.

all

If TRUE, all available fields defined in IDD for the class that objects belong to will be returned. Default: FALSE.

group_ext

Should be one of "none", "group" or "index". If not "none", value column in returned data.table::data.table() will be converted into a list. If "group", values from extensible fields will be grouped by the extensible group they belong to. For example, coordinate values of each vertex in class BuildingSurface:Detailed will be put into a list. If "index", values from extensible fields will be grouped by the extensible field indice they belong to. For example, coordinate values of all x coordinates will be put into a list. If "none", nothing special will be done. Default: "none".

Details

$to_table() returns a data.table that contains core data of current IdfObject. It has 6 columns:

  • id: Integer type. Object IDs.

  • name: Character type. Object names.

  • class: Character type. Current class name.

  • index: Integer type. Field indexes.

  • field: Character type. Field names.

  • value: Character type if string_value is TRUE or list type if string_value is FALSE or group_ext is not "none". Field values.

Note that when group_ext is not "none", index and field values will not match the original field indices and names. In this case, index will only indicate the indices of sequences. For field column, specifically:

  • When group_ext is "group", each field name in a extensible group will be abbreviated using abbreviate() with minlength being 10L and all abbreviated names will be separated by | and combined together. For example, field names in the extensible group (Vertex 1 X-coordinate, Vertex 1 Y-coordinate, Vertex 1 Z-coordinate) in class BuildiBuildingSurface:Detailed will be merged into one name Vrtx1X-crd|Vrtx1Y-crd|Vrtx1Z-crd.

  • When group_ext is "index", the extensible group indicator in field names will be removed. Take the same example as above, the resulting field names will be Vertex X-coordinate, Vertex Y-coordinate, and Vertex Z-coordinate.

Returns

A data.table with 6 columns (if wide is FALSE) or at least 6 columns (if wide is TRUE).

Examples

\dontrun{
# get all object data in a data.table format without field units
str(mat$to_table(unit = FALSE))

# get all object data in a data.table format where all field values are put in a
# list column and field names without unit
str(mat$to_table(string_value = FALSE, unit = FALSE))

# get all object data in a data.table format, including tailing empty fields
str(idf$Zone$`ZONE ONE`$to_table(all = TRUE))

# get all object data in a data.table format where each field becomes a column
str(mat$to_table(wide = TRUE))

# group extensible by extensible group number
surf <- idf$BuildingSurface_Detailed[["Zn001:Roof001"]]
surf$to_table(group_ext = "group")

# group extensible by extensible group number and convert into a wide table
surf$to_table(group_ext = "group", wide = TRUE)

# group extensible by extensible field index
surf$to_table(group_ext = "index")

# group extensible by extensible field index and convert into a wide table
surf$to_table(group_ext = "index", wide = TRUE)

# when grouping extensible, 'string_value' and 'unit' still take effect
surf$to_table(group_ext = "index", wide = TRUE, string_value = FALSE, unit = TRUE)
}


Method to_string()

Format current object as a character vector

Usage

IdfObject$to_string(comment = TRUE, leading = 4L, sep_at = 29L, all = FALSE)

Arguments

comment

If FALSE, all comments will not be included. Default: TRUE.

leading

Leading spaces added to each field. Default: 4L.

sep_at

The character width to separate value string and field string. Default: 29L which is the same as IDF Editor.

all

If TRUE, all available fields defined in IDD for the class that objects belong to will be returned. Default: FALSE.

Details

$to_string() returns the text format of current object.

Returns

A character vector.

Examples

\dontrun{
# get string format object
mat$to_string()

# get string format of object, and decrease the space between field values and
# field names
mat$to_string(sep_at = 15)

# get string format of object, and decrease the leading space of field values
mat$to_string(leading = 0)
}


Method print()

Print IdfObject object

Usage

IdfObject$print(comment = TRUE, auto_sep = TRUE, brief = FALSE)

Arguments

comment

If FALSE, all comments are not included.

auto_sep

If TRUE, values and field names are separated at the largest character length of values. Default: FALSE.

brief

If TRUE, only OBJECT part is printed. Default: FALSE.

Details

$print() prints the IdfObject. Basically, the print output can be divided into 3 parts:

  • OBJECT: Class name, object id and name (if applicable).

  • COMMENTS: Object comments if exist.

  • VALUES: fields and values of current IdfObject. Required fields are marked with start *. String values are quoted. Numeric values are printed as they are. Blank string values are printed as <"Blank"> and blank number values are printed as <Blank>.

Returns

The IdfObject itself, invisibly.

Examples

\dontrun{
# print the object without comment
mat$print(comment = FALSE)

# print the object, and auto separate field values and field names at the
# largetst character length of field values
mat$print(auto_sep = TRUE)
}


Method clone()

The objects of this class are cloneable with this method.

Usage

IdfObject$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

## ------------------------------------------------ ## Method `IdfObject$new` ## ------------------------------------------------ # \dontrun{ # example model shipped with eplusr from EnergyPlus v8.8 path_idf <- system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr") # v8.8 idf <- read_idf(path_idf, use_idd(8.8, "auto")) roof <- IdfObject$new(26, parent = idf) # get the IdfObject of material named "C5 - 4 IN HW CONCRETE" mat <- idf$Material[["C5 - 4 IN HW CONCRETE"]] # } ## ------------------------------------------------ ## Method `IdfObject$version` ## ------------------------------------------------ # \dontrun{ # get version roof$version()
#> [1] ‘8.8.0’
# } ## ------------------------------------------------ ## Method `IdfObject$parent` ## ------------------------------------------------ # \dontrun{ roof$parent()
#> ── EnergPlus Input Data File ─────────────────────────────────────────────────── #> * Path: '/tmp/Rtmp4QhbcD/temp_libpath3f9c63a4601c/eplusr/extdata/1ZoneUnco... #> * Version: '8.8.0' #> #> Group: <Simulation Parameters> #> ├─ [01<O>] Class: <Version> #> │─ [01<O>] Class: <SimulationControl> #> │─ [01<O>] Class: <Building> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Inside> #> │─ [01<O>] Class: <SurfaceConvectionAlgorithm:Outside> #> │─ [01<O>] Class: <HeatBalanceAlgorithm> #> └─ [01<O>] Class: <Timestep> #> #> Group: <Location and Climate> #> ├─ [01<O>] Class: <Site:Location> #> │─ [02<O>] Class: <SizingPeriod:DesignDay> #> └─ [01<O>] Class: <RunPeriod> #> #> Group: <Schedules> #> ├─ [02<O>] Class: <ScheduleTypeLimits> #> └─ [01<O>] Class: <Schedule:Constant> #> #> Group: <Surface Construction Elements> #> ├─ [01<O>] Class: <Material> #> │─ [02<O>] Class: <Material:NoMass> #> └─ [03<O>] Class: <Construction> #> #> Group: <Thermal Zones and Surfaces> #> ├─ [01<O>] Class: <GlobalGeometryRules> #> │─ [01<O>] Class: <Zone> #> └─ [06<O>] Class: <BuildingSurface:Detailed> #> #> Group: <Internal Gains> #> └─ [02<O>] Class: <OtherEquipment> #> #> Group: <Exterior Equipment> #> └─ [01<O>] Class: <Exterior:Lights> #> #> Group: <Output Reporting> #> ├─ [01<O>] Class: <Output:VariableDictionary> #> │─ [01<O>] Class: <Output:Surfaces:Drawing> #> │─ [01<O>] Class: <Output:Constructions> #> │─ [01<O>] Class: <Output:Table:SummaryReports> #> │─ [01<O>] Class: <OutputControl:Table:Style> #> │─ [14<O>] Class: <Output:Variable> #> └─ [03<O>] Class: <Output:Meter:MeterFileOnly>
# } ## ------------------------------------------------ ## Method `IdfObject$id` ## ------------------------------------------------ # \dontrun{ roof$id()
#> [1] 26
# } ## ------------------------------------------------ ## Method `IdfObject$name` ## ------------------------------------------------ # \dontrun{ roof$name()
#> [1] "Zn001:Roof001"
# NA will be returned if the class does not have name attribute. For example, # "Version" class idf$Version$name()
#> [1] NA
# } ## ------------------------------------------------ ## Method `IdfObject$group_name` ## ------------------------------------------------ # \dontrun{ roof$group_name()
#> [1] "Thermal Zones and Surfaces"
# } ## ------------------------------------------------ ## Method `IdfObject$class_name` ## ------------------------------------------------ # \dontrun{ roof$class_name()
#> [1] "BuildingSurface:Detailed"
# } ## ------------------------------------------------ ## Method `IdfObject$definition` ## ------------------------------------------------ # \dontrun{ roof$definition()
#> <IddObject: 'BuildingSurface:Detailed'> #> ── MEMO ──────────────────────────────────────────────────────────────────────── #> "Allows for detailed entry of building heat transfer surfaces. Does not include subsurfaces such as windows or doors." #> #> ── PROPERTIES ────────────────────────────────────────────────────────────────── #> * Group: 'Thermal Zones and Surfaces' #> * Unique: FALSE #> * Required: FALSE #> * Total fields: 370 #> #> ── FIELDS ────────────────────────────────────────────────────────────────────── #> 01*: Name #> 02*: Surface Type #> 03*: Construction Name #> 04*: Zone Name #> 05*: Outside Boundary Condition #> 06 : Outside Boundary Condition Object #> 07 : Sun Exposure #> 08 : Wind Exposure #> 09 : View Factor to Ground #> 10 : Number of Vertices #> 11*: Vertex 1 X-coordinate <↓> #> 12*: Vertex 1 Y-coordinate <↓> #> 13*: Vertex 1 Z-coordinate <↓> #> 14*: Vertex 2 X-coordinate <↓> #> 15*: Vertex 2 Y-coordinate <↓> #> 16*: Vertex 2 Z-coordinate <↓> #> 17*: Vertex 3 X-coordinate <↓> #> 18*: Vertex 3 Y-coordinate <↓> #> 19*: Vertex 3 Z-coordinate <↓> #> ......
# } ## ------------------------------------------------ ## Method `IdfObject$comment` ## ------------------------------------------------ # \dontrun{ # get object comments roof$comment()
#> NULL
# add new object comments roof$comment(c("This is a material named `WD01`", "This object has an ID of 47"))
#> <IdfObject: 'BuildingSurface:Detailed'> [ID:26] `Zn001:Roof001` #> ── COMMENTS ──────────────────────────────────────────────────────────────────── #> !This is a material named `WD01` #> !This object has an ID of 47 #> ── VALUES ────────────────────────────────────────────────────────────────────── #> Class: <BuildingSurface:Detailed> #> ├─ 01*: "Zn001:Roof001", !- Name #> │─ 02*: "Roof", !- Surface Type #> │─ 03*: "ROOF31", !- Construction Name #> │─ 04*: "ZONE ONE", !- Zone Name #> │─ 05*: "Outdoors", !- Outside Boundary Condition #> │─ 06 : <"Blank">, !- Outside Boundary Condition Object #> │─ 07 : "SunExposed", !- Sun Exposure #> │─ 08 : "WindExposed", !- Wind Exposure #> │─ 09 : 0, !- View Factor to Ground #> │─ 10 : 4, !- Number of Vertices #> │─ 11*: 0, !- Vertex 1 X-coordinate {m} #> │─ 12*: 15.24, !- Vertex 1 Y-coordinate {m} #> │─ 13*: 4.572, !- Vertex 1 Z-coordinate {m} #> │─ 14*: 0, !- Vertex 2 X-coordinate {m} #> │─ 15*: 0, !- Vertex 2 Y-coordinate {m} #> │─ 16*: 4.572, !- Vertex 2 Z-coordinate {m} #> │─ 17*: 15.24, !- Vertex 3 X-coordinate {m} #> │─ 18*: 0, !- Vertex 3 Y-coordinate {m} #> │─ 19*: 4.572, !- Vertex 3 Z-coordinate {m} #> │─ 20 : 15.24, !- Vertex 4 X-coordinate {m} #> │─ 21 : 15.24, !- Vertex 4 Y-coordinate {m} #> └─ 22 : 4.572; !- Vertex 4 Z-coordinate {m}
roof$comment()
#> [1] "This is a material named `WD01`" "This object has an ID of 47"
# append new comments roof$comment("This is an appended comment")
#> <IdfObject: 'BuildingSurface:Detailed'> [ID:26] `Zn001:Roof001` #> ── COMMENTS ──────────────────────────────────────────────────────────────────── #> !This is a material named `WD01` #> !This object has an ID of 47 #> !This is an appended comment #> ── VALUES ────────────────────────────────────────────────────────────────────── #> Class: <BuildingSurface:Detailed> #> ├─ 01*: "Zn001:Roof001", !- Name #> │─ 02*: "Roof", !- Surface Type #> │─ 03*: "ROOF31", !- Construction Name #> │─ 04*: "ZONE ONE", !- Zone Name #> │─ 05*: "Outdoors", !- Outside Boundary Condition #> │─ 06 : <"Blank">, !- Outside Boundary Condition Object #> │─ 07 : "SunExposed", !- Sun Exposure #> │─ 08 : "WindExposed", !- Wind Exposure #> │─ 09 : 0, !- View Factor to Ground #> │─ 10 : 4, !- Number of Vertices #> │─ 11*: 0, !- Vertex 1 X-coordinate {m} #> │─ 12*: 15.24, !- Vertex 1 Y-coordinate {m} #> │─ 13*: 4.572, !- Vertex 1 Z-coordinate {m} #> │─ 14*: 0, !- Vertex 2 X-coordinate {m} #> │─ 15*: 0, !- Vertex 2 Y-coordinate {m} #> │─ 16*: 4.572, !- Vertex 2 Z-coordinate {m} #> │─ 17*: 15.24, !- Vertex 3 X-coordinate {m} #> │─ 18*: 0, !- Vertex 3 Y-coordinate {m} #> │─ 19*: 4.572, !- Vertex 3 Z-coordinate {m} #> │─ 20 : 15.24, !- Vertex 4 X-coordinate {m} #> │─ 21 : 15.24, !- Vertex 4 Y-coordinate {m} #> └─ 22 : 4.572; !- Vertex 4 Z-coordinate {m}
roof$comment()
#> [1] "This is a material named `WD01`" "This object has an ID of 47" #> [3] "This is an appended comment"
# prepend new comments roof$comment("This is a prepended comment", append = FALSE)
#> <IdfObject: 'BuildingSurface:Detailed'> [ID:26] `Zn001:Roof001` #> ── COMMENTS ──────────────────────────────────────────────────────────────────── #> !This is a prepended comment #> !This is a material named `WD01` #> !This object has an ID of 47 #> !This is an appended comment #> ── VALUES ────────────────────────────────────────────────────────────────────── #> Class: <BuildingSurface:Detailed> #> ├─ 01*: "Zn001:Roof001", !- Name #> │─ 02*: "Roof", !- Surface Type #> │─ 03*: "ROOF31", !- Construction Name #> │─ 04*: "ZONE ONE", !- Zone Name #> │─ 05*: "Outdoors", !- Outside Boundary Condition #> │─ 06 : <"Blank">, !- Outside Boundary Condition Object #> │─ 07 : "SunExposed", !- Sun Exposure #> │─ 08 : "WindExposed", !- Wind Exposure #> │─ 09 : 0, !- View Factor to Ground #> │─ 10 : 4, !- Number of Vertices #> │─ 11*: 0, !- Vertex 1 X-coordinate {m} #> │─ 12*: 15.24, !- Vertex 1 Y-coordinate {m} #> │─ 13*: 4.572, !- Vertex 1 Z-coordinate {m} #> │─ 14*: 0, !- Vertex 2 X-coordinate {m} #> │─ 15*: 0, !- Vertex 2 Y-coordinate {m} #> │─ 16*: 4.572, !- Vertex 2 Z-coordinate {m} #> │─ 17*: 15.24, !- Vertex 3 X-coordinate {m} #> │─ 18*: 0, !- Vertex 3 Y-coordinate {m} #> │─ 19*: 4.572, !- Vertex 3 Z-coordinate {m} #> │─ 20 : 15.24, !- Vertex 4 X-coordinate {m} #> │─ 21 : 15.24, !- Vertex 4 Y-coordinate {m} #> └─ 22 : 4.572; !- Vertex 4 Z-coordinate {m}
roof$comment()
#> [1] "This is a prepended comment" "This is a material named `WD01`" #> [3] "This object has an ID of 47" "This is an appended comment"
# wrap long comments roof$comment("This is a very long comment that is needed to be wrapped.", width = 30)
#> <IdfObject: 'BuildingSurface:Detailed'> [ID:26] `Zn001:Roof001` #> ── COMMENTS ──────────────────────────────────────────────────────────────────── #> !This is a prepended comment #> !This is a material named `WD01` #> !This object has an ID of 47 #> !This is an appended comment #> !This is a very long comment #> !that is needed to be wrapped. #> ── VALUES ────────────────────────────────────────────────────────────────────── #> Class: <BuildingSurface:Detailed> #> ├─ 01*: "Zn001:Roof001", !- Name #> │─ 02*: "Roof", !- Surface Type #> │─ 03*: "ROOF31", !- Construction Name #> │─ 04*: "ZONE ONE", !- Zone Name #> │─ 05*: "Outdoors", !- Outside Boundary Condition #> │─ 06 : <"Blank">, !- Outside Boundary Condition Object #> │─ 07 : "SunExposed", !- Sun Exposure #> │─ 08 : "WindExposed", !- Wind Exposure #> │─ 09 : 0, !- View Factor to Ground #> │─ 10 : 4, !- Number of Vertices #> │─ 11*: 0, !- Vertex 1 X-coordinate {m} #> │─ 12*: 15.24, !- Vertex 1 Y-coordinate {m} #> │─ 13*: 4.572, !- Vertex 1 Z-coordinate {m} #> │─ 14*: 0, !- Vertex 2 X-coordinate {m} #> │─ 15*: 0, !- Vertex 2 Y-coordinate {m} #> │─ 16*: 4.572, !- Vertex 2 Z-coordinate {m} #> │─ 17*: 15.24, !- Vertex 3 X-coordinate {m} #> │─ 18*: 0, !- Vertex 3 Y-coordinate {m} #> │─ 19*: 4.572, !- Vertex 3 Z-coordinate {m} #> │─ 20 : 15.24, !- Vertex 4 X-coordinate {m} #> │─ 21 : 15.24, !- Vertex 4 Y-coordinate {m} #> └─ 22 : 4.572; !- Vertex 4 Z-coordinate {m}
roof$comment()
#> [1] "This is a prepended comment" "This is a material named `WD01`" #> [3] "This object has an ID of 47" "This is an appended comment" #> [5] "This is a very long comment" "that is needed to be wrapped."
# delete old comments and add new one roof$comment("This is the only comment", append = NULL)
#> <IdfObject: 'BuildingSurface:Detailed'> [ID:26] `Zn001:Roof001` #> ── COMMENTS ──────────────────────────────────────────────────────────────────── #> !This is the only comment #> ── VALUES ────────────────────────────────────────────────────────────────────── #> Class: <BuildingSurface:Detailed> #> ├─ 01*: "Zn001:Roof001", !- Name #> │─ 02*: "Roof", !- Surface Type #> │─ 03*: "ROOF31", !- Construction Name #> │─ 04*: "ZONE ONE", !- Zone Name #> │─ 05*: "Outdoors", !- Outside Boundary Condition #> │─ 06 : <"Blank">, !- Outside Boundary Condition Object #> │─ 07 : "SunExposed", !- Sun Exposure #> │─ 08 : "WindExposed", !- Wind Exposure #> │─ 09 : 0, !- View Factor to Ground #> │─ 10 : 4, !- Number of Vertices #> │─ 11*: 0, !- Vertex 1 X-coordinate {m} #> │─ 12*: 15.24, !- Vertex 1 Y-coordinate {m} #> │─ 13*: 4.572, !- Vertex 1 Z-coordinate {m} #> │─ 14*: 0, !- Vertex 2 X-coordinate {m} #> │─ 15*: 0, !- Vertex 2 Y-coordinate {m} #> │─ 16*: 4.572, !- Vertex 2 Z-coordinate {m} #> │─ 17*: 15.24, !- Vertex 3 X-coordinate {m} #> │─ 18*: 0, !- Vertex 3 Y-coordinate {m} #> │─ 19*: 4.572, !- Vertex 3 Z-coordinate {m} #> │─ 20 : 15.24, !- Vertex 4 X-coordinate {m} #> │─ 21 : 15.24, !- Vertex 4 Y-coordinate {m} #> └─ 22 : 4.572; !- Vertex 4 Z-coordinate {m}
roof$comment()
#> [1] "This is the only comment"
# delete all comments roof$comment(NULL)
#> <IdfObject: 'BuildingSurface:Detailed'> [ID:26] `Zn001:Roof001` #> Class: <BuildingSurface:Detailed> #> ├─ 01*: "Zn001:Roof001", !- Name #> │─ 02*: "Roof", !- Surface Type #> │─ 03*: "ROOF31", !- Construction Name #> │─ 04*: "ZONE ONE", !- Zone Name #> │─ 05*: "Outdoors", !- Outside Boundary Condition #> │─ 06 : <"Blank">, !- Outside Boundary Condition Object #> │─ 07 : "SunExposed", !- Sun Exposure #> │─ 08 : "WindExposed", !- Wind Exposure #> │─ 09 : 0, !- View Factor to Ground #> │─ 10 : 4, !- Number of Vertices #> │─ 11*: 0, !- Vertex 1 X-coordinate {m} #> │─ 12*: 15.24, !- Vertex 1 Y-coordinate {m} #> │─ 13*: 4.572, !- Vertex 1 Z-coordinate {m} #> │─ 14*: 0, !- Vertex 2 X-coordinate {m} #> │─ 15*: 0, !- Vertex 2 Y-coordinate {m} #> │─ 16*: 4.572, !- Vertex 2 Z-coordinate {m} #> │─ 17*: 15.24, !- Vertex 3 X-coordinate {m} #> │─ 18*: 0, !- Vertex 3 Y-coordinate {m} #> │─ 19*: 4.572, !- Vertex 3 Z-coordinate {m} #> │─ 20 : 15.24, !- Vertex 4 X-coordinate {m} #> │─ 21 : 15.24, !- Vertex 4 Y-coordinate {m} #> └─ 22 : 4.572; !- Vertex 4 Z-coordinate {m}
roof$comment()
#> NULL
# } ## ------------------------------------------------ ## Method `IdfObject$value` ## ------------------------------------------------ # \dontrun{ # get all existing field values str(mat$value())
#> List of 9 #> $ Name : chr "C5 - 4 IN HW CONCRETE" #> $ Roughness : chr "MediumRough" #> $ Thickness : num 0.101 #> $ Conductivity : num 1.73 #> $ Density : num 2243 #> $ Specific Heat : num 837 #> $ Thermal Absorptance: num 0.9 #> $ Solar Absorptance : num 0.65 #> $ Visible Absorptance: num 0.65
# get values of field 1, 3, 5 str(mat$value(c(1, 3, 5)))
#> List of 3 #> $ Name : chr "C5 - 4 IN HW CONCRETE" #> $ Thickness: num 0.101 #> $ Density : num 2243
# get character format values instead of a named list mat$value(c(1, 3, 5), simplify = TRUE)
#> [1] "C5 - 4 IN HW CONCRETE" "0.1014984" "2242.585"
# get values of all field even those that are not set str(roof$value())
#> List of 22 #> $ Name : chr "Zn001:Roof001" #> $ Surface Type : chr "Roof" #> $ Construction Name : chr "ROOF31" #> $ Zone Name : chr "ZONE ONE" #> $ Outside Boundary Condition : chr "Outdoors" #> $ Outside Boundary Condition Object: chr NA #> $ Sun Exposure : chr "SunExposed" #> $ Wind Exposure : chr "WindExposed" #> $ View Factor to Ground : num 0 #> $ Number of Vertices : num 4 #> $ Vertex 1 X-coordinate : num 0 #> $ Vertex 1 Y-coordinate : num 15.2 #> $ Vertex 1 Z-coordinate : num 4.57 #> $ Vertex 2 X-coordinate : num 0 #> $ Vertex 2 Y-coordinate : num 0 #> $ Vertex 2 Z-coordinate : num 4.57 #> $ Vertex 3 X-coordinate : num 15.2 #> $ Vertex 3 Y-coordinate : num 0 #> $ Vertex 3 Z-coordinate : num 4.57 #> $ Vertex 4 X-coordinate : num 15.2 #> $ Vertex 4 Y-coordinate : num 15.2 #> $ Vertex 4 Z-coordinate : num 4.57
str(roof$value(all = TRUE))
#> List of 370 #> $ Name : chr "Zn001:Roof001" #> $ Surface Type : chr "Roof" #> $ Construction Name : chr "ROOF31" #> $ Zone Name : chr "ZONE ONE" #> $ Outside Boundary Condition : chr "Outdoors" #> $ Outside Boundary Condition Object: chr NA #> $ Sun Exposure : chr "SunExposed" #> $ Wind Exposure : chr "WindExposed" #> $ View Factor to Ground : num 0 #> $ Number of Vertices : num 4 #> $ Vertex 1 X-coordinate : num 0 #> $ Vertex 1 Y-coordinate : num 15.2 #> $ Vertex 1 Z-coordinate : num 4.57 #> $ Vertex 2 X-coordinate : num 0 #> $ Vertex 2 Y-coordinate : num 0 #> $ Vertex 2 Z-coordinate : num 4.57 #> $ Vertex 3 X-coordinate : num 15.2 #> $ Vertex 3 Y-coordinate : num 0 #> $ Vertex 3 Z-coordinate : num 4.57 #> $ Vertex 4 X-coordinate : num 15.2 #> $ Vertex 4 Y-coordinate : num 15.2 #> $ Vertex 4 Z-coordinate : num 4.57 #> $ Vertex 5 X-coordinate : num NA #> $ Vertex 5 Y-coordinate : num NA #> $ Vertex 5 Z-coordinate : num NA #> $ Vertex 6 X-coordinate : num NA #> $ Vertex 6 Y-coordinate : num NA #> $ Vertex 6 Z-coordinate : num NA #> $ Vertex 7 X-coordinate : num NA #> $ Vertex 7 Y-coordinate : num NA #> $ Vertex 7 Z-coordinate : num NA #> $ Vertex 8 X-coordinate : num NA #> $ Vertex 8 Y-coordinate : num NA #> $ Vertex 8 Z-coordinate : num NA #> $ Vertex 9 X-coordinate : num NA #> $ Vertex 9 Y-coordinate : num NA #> $ Vertex 9 Z-coordinate : num NA #> $ Vertex 10 X-coordinate : num NA #> $ Vertex 10 Y-coordinate : num NA #> $ Vertex 10 Z-coordinate : num NA #> $ Vertex 11 X-coordinate : num NA #> $ Vertex 11 Y-coordinate : num NA #> $ Vertex 11 Z-coordinate : num NA #> $ Vertex 12 X-coordinate : num NA #> $ Vertex 12 Y-coordinate : num NA #> $ Vertex 12 Z-coordinate : num NA #> $ Vertex 13 X-coordinate : num NA #> $ Vertex 13 Y-coordinate : num NA #> $ Vertex 13 Z-coordinate : num NA #> $ Vertex 14 X-coordinate : num NA #> $ Vertex 14 Y-coordinate : num NA #> $ Vertex 14 Z-coordinate : num NA #> $ Vertex 15 X-coordinate : num NA #> $ Vertex 15 Y-coordinate : num NA #> $ Vertex 15 Z-coordinate : num NA #> $ Vertex 16 X-coordinate : num NA #> $ Vertex 16 Y-coordinate : num NA #> $ Vertex 16 Z-coordinate : num NA #> $ Vertex 17 X-coordinate : num NA #> $ Vertex 17 Y-coordinate : num NA #> $ Vertex 17 Z-coordinate : num NA #> $ Vertex 18 X-coordinate : num NA #> $ Vertex 18 Y-coordinate : num NA #> $ Vertex 18 Z-coordinate : num NA #> $ Vertex 19 X-coordinate : num NA #> $ Vertex 19 Y-coordinate : num NA #> $ Vertex 19 Z-coordinate : num NA #> $ Vertex 20 X-coordinate : num NA #> $ Vertex 20 Y-coordinate : num NA #> $ Vertex 20 Z-coordinate : num NA #> $ Vertex 21 X-coordinate : num NA #> $ Vertex 21 Y-coordinate : num NA #> $ Vertex 21 Z-coordinate : num NA #> $ Vertex 22 X-coordinate : num NA #> $ Vertex 22 Y-coordinate : num NA #> $ Vertex 22 Z-coordinate : num NA #> $ Vertex 23 X-coordinate : num NA #> $ Vertex 23 Y-coordinate : num NA #> $ Vertex 23 Z-coordinate : num NA #> $ Vertex 24 X-coordinate : num NA #> $ Vertex 24 Y-coordinate : num NA #> $ Vertex 24 Z-coordinate : num NA #> $ Vertex 25 X-coordinate : num NA #> $ Vertex 25 Y-coordinate : num NA #> $ Vertex 25 Z-coordinate : num NA #> $ Vertex 26 X-coordinate : num NA #> $ Vertex 26 Y-coordinate : num NA #> $ Vertex 26 Z-coordinate : num NA #> $ Vertex 27 X-coordinate : num NA #> $ Vertex 27 Y-coordinate : num NA #> $ Vertex 27 Z-coordinate : num NA #> $ Vertex 28 X-coordinate : num NA #> $ Vertex 28 Y-coordinate : num NA #> $ Vertex 28 Z-coordinate : num NA #> $ Vertex 29 X-coordinate : num NA #> $ Vertex 29 Y-coordinate : num NA #> $ Vertex 29 Z-coordinate : num NA #> $ Vertex 30 X-coordinate : num NA #> $ Vertex 30 Y-coordinate : num NA #> [list output truncated]
# get field values using shortcuts mat$Roughness
#> [1] "MediumRough"
mat[["Specific_Heat"]]
#> NULL
mat[c(1,2)]
#> $Name #> [1] "C5 - 4 IN HW CONCRETE" #> #> $Roughness #> [1] "MediumRough" #>
mat[c("Name", "Density")]
#> $Name #> [1] "C5 - 4 IN HW CONCRETE" #> #> $Density #> [1] 2242.585 #>
# } ## ------------------------------------------------ ## Method `IdfObject$set` ## ------------------------------------------------ # \dontrun{ # set field values mat$set(name = "new_name", Thickness = 0.02)
#> <IdfObject: 'Material'> [ID:14] `new_name` #> Class: <Material> #> ├─ 1*: "new_name", !- Name #> │─ 2*: "MediumRough", !- Roughness #> │─ 3*: 0.02, !- Thickness {m} #> │─ 4*: 1.729577, !- Conductivity {W/m-K} #> │─ 5*: 2242.585, !- Density {kg/m3} #> │─ 6*: 836.8, !- Specific Heat {J/kg-K} #> │─ 7 : 0.9, !- Thermal Absorptance #> │─ 8 : 0.65, !- Solar Absorptance #> └─ 9 : 0.65; !- Visible Absorptance
mat[c("Name", "Thickness")]
#> $Name #> [1] "new_name" #> #> $Thickness #> [1] 0.02 #>
# When `default` argument is set to TRUE and input field values are empty, i.e. # NULL, the field values will be reset to defaults. mat[c("Thermal Absorptance", "Solar Absorptance")]
#> $`Thermal Absorptance` #> [1] 0.9 #> #> $`Solar Absorptance` #> [1] 0.65 #>
mat$set(visible_absorptance = NULL, Solar_Absorptance = NULL, .default = TRUE)
#> <IdfObject: 'Material'> [ID:14] `new_name` #> Class: <Material> #> ├─ 1*: "new_name", !- Name #> │─ 2*: "MediumRough", !- Roughness #> │─ 3*: 0.02, !- Thickness {m} #> │─ 4*: 1.729577, !- Conductivity {W/m-K} #> │─ 5*: 2242.585, !- Density {kg/m3} #> │─ 6*: 836.8, !- Specific Heat {J/kg-K} #> │─ 7 : 0.9, !- Thermal Absorptance #> │─ 8 : 0.7, !- Solar Absorptance #> └─ 9 : 0.7; !- Visible Absorptance
mat[c("Visible Absorptance", "Solar Absorptance")]
#> $`Visible Absorptance` #> [1] 0.7 #> #> $`Solar Absorptance` #> [1] 0.7 #>
# set field values using shortcuts mat$Name <- "another_name" mat$Name
#> [1] "another_name"
mat[["Thickness"]] <- 0.019 mat$Thickness
#> [1] 0.019
# } ## ------------------------------------------------ ## Method `IdfObject$value_possible` ## ------------------------------------------------ # \dontrun{ mat$value_possible()
#> ── 1: Name ───────────────────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: <NA> #> * Choice: <NA> #> * Source: <NA> #> #> ── 2: Roughness ──────────────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: <NA> #> * Choice: #> - "VeryRough" #> - "Rough" #> - "MediumRough" #> - "MediumSmooth" #> - "Smooth" #> - "......" #> * Source: <NA> #> #> ── 3: Thickness ──────────────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: NA #> * Choice: <NA> #> * Source: <NA> #> #> ── 4: Conductivity ───────────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: NA #> * Choice: <NA> #> * Source: <NA> #> #> ── 5: Density ────────────────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: NA #> * Choice: <NA> #> * Source: <NA> #> #> ── 6: Specific Heat ──────────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: NA #> * Choice: <NA> #> * Source: <NA> #> #> ── 7: Thermal Absorptance ────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: 0.9 #> * Choice: <NA> #> * Source: <NA> #> #> ── 8: Solar Absorptance ──────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: 0.7 #> * Choice: <NA> #> * Source: <NA> #> #> ── 9: Visible Absorptance ────────────────────────────────────────────────────── #> * Auto value: <NA> #> * Default: 0.7 #> * Choice: <NA> #> * Source: <NA> #>
# } ## ------------------------------------------------ ## Method `IdfObject$validate` ## ------------------------------------------------ # \dontrun{ mat$validate()
#> ✔ No error found.
# check at predefined validate level mat$validate("none")
#> ✔ No error found.
mat$validate("draft")
#> ✔ No error found.
mat$validate("final")
#> ✔ No error found.
# custom validate checking components mat$validate(custom_validate(auto_field = TRUE, choice = TRUE))
#> ✔ No error found.
# } ## ------------------------------------------------ ## Method `IdfObject$is_valid` ## ------------------------------------------------ # \dontrun{ mat$is_valid()
#> [1] TRUE
mat$definition()$field_range("Density")
#> [[1]] #> (0, Inf) #>
eplusr_option(validate_level = "none") # have to set validate to "none" to do so
#> $validate_level #> [1] "none" #>
mat$Density <- -1 eplusr_option(validate_level = "final") # change back to "final" validate level
#> $validate_level #> [1] "final" #>
mat$is_valid()
#> [1] FALSE
# check at predefined validate level mat$is_valid("none")
#> [1] TRUE
mat$is_valid("draft")
#> [1] FALSE
mat$is_valid("final")
#> [1] FALSE
# custom validate checking components mat$is_valid(custom_validate(auto_field = TRUE, choice = TRUE))
#> [1] TRUE
# } ## ------------------------------------------------ ## Method `IdfObject$value_relation` ## ------------------------------------------------ # \dontrun{ # check each layer's reference of a construction named FLOOR roof$value_relation("zone name", "ref_to")
#> ── Refer to Others ───────────────────────────────────────────────────────────── #> └─ 4: "ZONE ONE"; !- Zone Name #> v~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #> └─ Class: <Zone> #> └─ Object [ID:18] <ZONE ONE> #> └─ 1: "ZONE ONE"; !- Name #>
# check where is this construction being used roof$value_relation("name", direction = "ref_by")
#> ── Referred by Others ────────────────────────────────────────────────────────── #> └─ 1: "Zn001:Roof001"; !- Name #>
# } ## ------------------------------------------------ ## Method `IdfObject$ref_to_object` ## ------------------------------------------------ # \dontrun{ # get other objects that this object refereces mat$ref_to_object() # not referencing other objects
#> Target object does not refer to any other object.
# } ## ------------------------------------------------ ## Method `IdfObject$ref_by_object` ## ------------------------------------------------ # \dontrun{ # get other objects that reference this object mat$ref_by_object() # referenced by construction "FLOOR"
#> Target object is referred by 1 object(s) [ID:'16'].
#> $FLOOR #> <IdfObject: 'Construction'> [ID:16] `FLOOR` #> Class: <Construction> #> ├─ 1*: "FLOOR", !- Name #> └─ 2*: "another_name"; !- Outside Layer #>
# } ## ------------------------------------------------ ## Method `IdfObject$ref_to_node` ## ------------------------------------------------ # \dontrun{ if (is_avail_eplus(8.8)) { path <- file.path(eplus_config(8.8)$dir, "ExampleFiles/5Zone_Transformer.idf") idf_5z <- read_idf(path) idf_5z$NodeList$OutsideAirInletNodes$ref_to_node() }
#> Target object has node(s) referring to 4 object(s) [ID:'260', '200', '206' and '286'].
#> $<NA> #> <IdfObject: 'OutdoorAir:NodeList'> [ID:260] #> Class: <OutdoorAir:NodeList> #> └─ 1*: "OutsideAirInletNodes"; !- Node or NodeList Name 1 #> #> $`OA Heating Coil 1` #> <IdfObject: 'Coil:Heating:Water'> [ID:200] `OA Heating Coil 1` #> Class: <Coil:Heating:Water> #> ├─ 01*: "OA Heating Coil 1",!- Name #> │─ 02 : "CoolingCoilAvailSched", !- Availability Schedule Name #> │─ 03 : autosize, !- U-Factor Times Area Value {W/K} #> │─ 04 : autosize, !- Maximum Water Flow Rate {m3/s} #> │─ 05*: "OA Heating Coil 1 Water Inlet Node", !- Water Inlet Node Name #> │─ 06*: "OA Heating Coil 1 Water Outlet Node", !- Water Outlet Node Name #> │─ 07*: "Outside Air Inlet Node 1", !- Air Inlet Node Name #> │─ 08*: "OA Heating Coil 1 Air Outlet Node", !- Air Outlet Node Name #> │─ 09 : "UFactorTimesAreaAndDesignWaterFlowRate", !- Performance Input Met... #> │─ 10 : autosize, !- Rated Capacity {W} #> │─ 11 : 82.2, !- Rated Inlet Water Temperature {C} #> │─ 12 : 16.6, !- Rated Inlet Air Temperature {C} #> │─ 13 : 71.1, !- Rated Outlet Water Temperature {C} #> │─ 14 : 32.2, !- Rated Outlet Air Temperature {C} #> └─ 15 : <Blank>; !- Rated Ratio for Air and Water Convection #> #> $`OA Controller 1` #> <IdfObject: 'Controller:OutdoorAir'> [ID:206] `OA Controller 1` #> Class: <Controller:OutdoorAir> #> ├─ 01*: "OA Controller 1", !- Name #> │─ 02*: "Relief Air Outlet Node 1", !- Relief Air Outlet Node Name #> │─ 03*: "VAV Sys 1 Inlet Node", !- Return Air Node Name #> │─ 04*: "Mixed Air Node 1", !- Mixed Air Node Name #> │─ 05*: "Outside Air Inlet Node 1", !- Actuator Node Name #> │─ 06*: autosize, !- Minimum Outdoor Air Flow Rate {m3/s} #> │─ 07*: autosize, !- Maximum Outdoor Air Flow Rate {m3/s} #> │─ 08 : "NoEconomizer", !- Economizer Control Type #> │─ 09 : "ModulateFlow", !- Economizer Control Action Type #> │─ 10 : 19, !- Economizer Maximum Limit Dry-Bulb Temperatur... #> │─ 11 : <Blank>, !- Economizer Maximum Limit Enthalpy {J/kg} #> │─ 12 : <Blank>, !- Economizer Maximum Limit Dewpoint Temperatur... #> │─ 13 : <"Blank">, !- Electronic Enthalpy Limit Curve Name #> │─ 14 : 4.6, !- Economizer Minimum Limit Dry-Bulb Temperatur... #> │─ 15 : "NoLockout", !- Lockout Type #> │─ 16 : "FixedMinimum", !- Minimum Limit Type #> └─ 17 : "Min OA Sched"; !- Minimum Outdoor Air Schedule Name #> #> $`CW Low Temp Limit` #> <IdfObject: 'AvailabilityManager:LowTemperatureTurnOff'> [ID:286] `CW Low Temp Limit` #> Class: <AvailabilityManager:LowTemperatureTurnOff> #> ├─ 1*: "CW Low Temp Limit",!- Name #> │─ 2*: "Outside Air Inlet Node 1", !- Sensor Node Name #> │─ 3*: 2, !- Temperature {C} #> └─ 4 : "CoolingPumpAvailSched"; !- Applicability Schedule Name #>
# } ## ------------------------------------------------ ## Method `IdfObject$has_ref_to` ## ------------------------------------------------ # \dontrun{ mat$has_ref_to()
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
# } ## ------------------------------------------------ ## Method `IdfObject$has_ref_by` ## ------------------------------------------------ # \dontrun{ mat$has_ref_by()
#> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
# } ## ------------------------------------------------ ## Method `IdfObject$has_ref_node` ## ------------------------------------------------ # \dontrun{ mat$has_ref_node()
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
# } ## ------------------------------------------------ ## Method `IdfObject$has_ref` ## ------------------------------------------------ # \dontrun{ # check if having any referenced objects or is referenced by other objects mat$has_ref()
#> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
# } ## ------------------------------------------------ ## Method `IdfObject$to_table` ## ------------------------------------------------ # \dontrun{ # get all object data in a data.table format without field units str(mat$to_table(unit = FALSE))
#> Classes ‘data.table’ and 'data.frame': 9 obs. of 6 variables: #> $ id : int 14 14 14 14 14 14 14 14 14 #> $ name : chr "another_name" "another_name" "another_name" "another_name" ... #> $ class: chr "Material" "Material" "Material" "Material" ... #> $ index: int 1 2 3 4 5 6 7 8 9 #> $ field: chr "Name" "Roughness" "Thickness" "Conductivity" ... #> $ value: chr "another_name" "MediumRough" "0.019" "1.729577" ... #> - attr(*, ".internal.selfref")=<externalptr>
# get all object data in a data.table format where all field values are put in a # list column and field names without unit str(mat$to_table(string_value = FALSE, unit = FALSE))
#> Classes ‘data.table’ and 'data.frame': 9 obs. of 6 variables: #> $ id : int 14 14 14 14 14 14 14 14 14 #> $ name : chr "another_name" "another_name" "another_name" "another_name" ... #> $ class: chr "Material" "Material" "Material" "Material" ... #> $ index: int 1 2 3 4 5 6 7 8 9 #> $ field: chr "Name" "Roughness" "Thickness" "Conductivity" ... #> $ value:List of 9 #> ..$ : chr "another_name" #> ..$ : chr "MediumRough" #> ..$ : num 0.019 #> ..$ : num 1.73 #> ..$ : num -1 #> ..$ : num 837 #> ..$ : num 0.9 #> ..$ : num 0.7 #> ..$ : num 0.7 #> - attr(*, ".internal.selfref")=<externalptr>
# get all object data in a data.table format, including tailing empty fields str(idf$Zone$`ZONE ONE`$to_table(all = TRUE))
#> Classes ‘data.table’ and 'data.frame': 13 obs. of 6 variables: #> $ id : int 18 18 18 18 18 18 18 18 18 18 ... #> $ name : chr "ZONE ONE" "ZONE ONE" "ZONE ONE" "ZONE ONE" ... #> $ class: chr "Zone" "Zone" "Zone" "Zone" ... #> $ index: int 1 2 3 4 5 6 7 8 9 10 ... #> $ field: chr "Name" "Direction of Relative North" "X Origin" "Y Origin" ... #> $ value: chr "ZONE ONE" "0" "0" "0" ... #> - attr(*, ".internal.selfref")=<externalptr>
# get all object data in a data.table format where each field becomes a column str(mat$to_table(wide = TRUE))
#> Classes ‘data.table’ and 'data.frame': 1 obs. of 12 variables: #> $ id : int 14 #> $ name : chr "another_name" #> $ class : chr "Material" #> $ Name : chr "another_name" #> $ Roughness : chr "MediumRough" #> $ Thickness : chr "0.019" #> $ Conductivity : chr "1.729577" #> $ Density : chr "-1" #> $ Specific Heat : chr "836.8" #> $ Thermal Absorptance: chr "0.9" #> $ Solar Absorptance : chr ".7" #> $ Visible Absorptance: chr ".7" #> - attr(*, ".internal.selfref")=<externalptr>
# group extensible by extensible group number surf <- idf$BuildingSurface_Detailed[["Zn001:Roof001"]] surf$to_table(group_ext = "group")
#> id name class index #> 1: 26 Zn001:Roof001 BuildingSurface:Detailed 1 #> 2: 26 Zn001:Roof001 BuildingSurface:Detailed 2 #> 3: 26 Zn001:Roof001 BuildingSurface:Detailed 3 #> 4: 26 Zn001:Roof001 BuildingSurface:Detailed 4 #> 5: 26 Zn001:Roof001 BuildingSurface:Detailed 5 #> 6: 26 Zn001:Roof001 BuildingSurface:Detailed 6 #> 7: 26 Zn001:Roof001 BuildingSurface:Detailed 7 #> 8: 26 Zn001:Roof001 BuildingSurface:Detailed 8 #> 9: 26 Zn001:Roof001 BuildingSurface:Detailed 9 #> 10: 26 Zn001:Roof001 BuildingSurface:Detailed 10 #> 11: 26 Zn001:Roof001 BuildingSurface:Detailed 11 #> 12: 26 Zn001:Roof001 BuildingSurface:Detailed 12 #> 13: 26 Zn001:Roof001 BuildingSurface:Detailed 13 #> 14: 26 Zn001:Roof001 BuildingSurface:Detailed 14 #> field value #> 1: Name Zn001:Roof001 #> 2: Surface Type Roof #> 3: Construction Name ROOF31 #> 4: Zone Name ZONE ONE #> 5: Outside Boundary Condition Outdoors #> 6: Outside Boundary Condition Object NA #> 7: Sun Exposure SunExposed #> 8: Wind Exposure WindExposed #> 9: View Factor to Ground 0 #> 10: Number of Vertices 4 #> 11: Vrtx1X-crd|Vrtx1Y-crd|Vrtx1Z-crd 0,15.24,4.572 #> 12: Vrtx2X-crd|Vrtx2Y-crd|Vrtx2Z-crd 0,0,4.572 #> 13: Vrtx3X-crd|Vrtx3Y-crd|Vrtx3Z-crd 15.24,0,4.572 #> 14: Vrtx4X-crd|Vrtx4Y-crd|Vrtx4Z-crd 15.24,15.24,4.572
# group extensible by extensible group number and convert into a wide table surf$to_table(group_ext = "group", wide = TRUE)
#> id name class Name Surface Type #> 1: 26 Zn001:Roof001 BuildingSurface:Detailed Zn001:Roof001 Roof #> Construction Name Zone Name Outside Boundary Condition #> 1: ROOF31 ZONE ONE Outdoors #> Outside Boundary Condition Object Sun Exposure Wind Exposure #> 1: NA SunExposed WindExposed #> View Factor to Ground Number of Vertices Vrtx1X-crd|Vrtx1Y-crd|Vrtx1Z-crd #> 1: 0 4 0,15.24,4.572 #> Vrtx2X-crd|Vrtx2Y-crd|Vrtx2Z-crd Vrtx3X-crd|Vrtx3Y-crd|Vrtx3Z-crd #> 1: 0,0,4.572 15.24,0,4.572 #> Vrtx4X-crd|Vrtx4Y-crd|Vrtx4Z-crd #> 1: 15.24,15.24,4.572
# group extensible by extensible field index surf$to_table(group_ext = "index")
#> id name class index #> 1: 26 Zn001:Roof001 BuildingSurface:Detailed 1 #> 2: 26 Zn001:Roof001 BuildingSurface:Detailed 2 #> 3: 26 Zn001:Roof001 BuildingSurface:Detailed 3 #> 4: 26 Zn001:Roof001 BuildingSurface:Detailed 4 #> 5: 26 Zn001:Roof001 BuildingSurface:Detailed 5 #> 6: 26 Zn001:Roof001 BuildingSurface:Detailed 6 #> 7: 26 Zn001:Roof001 BuildingSurface:Detailed 7 #> 8: 26 Zn001:Roof001 BuildingSurface:Detailed 8 #> 9: 26 Zn001:Roof001 BuildingSurface:Detailed 9 #> 10: 26 Zn001:Roof001 BuildingSurface:Detailed 10 #> 11: 26 Zn001:Roof001 BuildingSurface:Detailed 11 #> 12: 26 Zn001:Roof001 BuildingSurface:Detailed 12 #> 13: 26 Zn001:Roof001 BuildingSurface:Detailed 13 #> field value #> 1: Name Zn001:Roof001 #> 2: Surface Type Roof #> 3: Construction Name ROOF31 #> 4: Zone Name ZONE ONE #> 5: Outside Boundary Condition Outdoors #> 6: Outside Boundary Condition Object NA #> 7: Sun Exposure SunExposed #> 8: Wind Exposure WindExposed #> 9: View Factor to Ground 0 #> 10: Number of Vertices 4 #> 11: Vertex X-coordinate 0,0,15.24,15.24 #> 12: Vertex Y-coordinate 15.24,0,0,15.24 #> 13: Vertex Z-coordinate 4.572,4.572,4.572,4.572
# group extensible by extensible field index and convert into a wide table surf$to_table(group_ext = "index", wide = TRUE)
#> id name class Name Surface Type #> 1: 26 Zn001:Roof001 BuildingSurface:Detailed Zn001:Roof001 Roof #> Construction Name Zone Name Outside Boundary Condition #> 1: ROOF31 ZONE ONE Outdoors #> Outside Boundary Condition Object Sun Exposure Wind Exposure #> 1: NA SunExposed WindExposed #> View Factor to Ground Number of Vertices Vertex X-coordinate #> 1: 0 4 0,0,15.24,15.24 #> Vertex Y-coordinate Vertex Z-coordinate #> 1: 15.24,0,0,15.24 4.572,4.572,4.572,4.572
# when grouping extensible, 'string_value' and 'unit' still take effect surf$to_table(group_ext = "index", wide = TRUE, string_value = FALSE, unit = TRUE)
#> id name class Name Surface Type #> 1: 26 Zn001:Roof001 BuildingSurface:Detailed Zn001:Roof001 Roof #> Construction Name Zone Name Outside Boundary Condition #> 1: ROOF31 ZONE ONE Outdoors #> Outside Boundary Condition Object Sun Exposure Wind Exposure #> 1: <NA> SunExposed WindExposed #> View Factor to Ground Number of Vertices #> 1: 0 4 #> Vertex X-coordinate #> 1: 0.00 [m], 0.00 [m],15.24 [m],15.24 [m] #> Vertex Y-coordinate #> 1: 15.24 [m], 0.00 [m], 0.00 [m],15.24 [m] #> Vertex Z-coordinate #> 1: 4.572 [m],4.572 [m],4.572 [m],4.572 [m]
# } ## ------------------------------------------------ ## Method `IdfObject$to_string` ## ------------------------------------------------ # \dontrun{ # get string format object mat$to_string()
#> [1] "Material," #> [2] " another_name, !- Name" #> [3] " MediumRough, !- Roughness" #> [4] " 0.019, !- Thickness {m}" #> [5] " 1.729577, !- Conductivity {W/m-K}" #> [6] " -1, !- Density {kg/m3}" #> [7] " 836.8, !- Specific Heat {J/kg-K}" #> [8] " 0.9, !- Thermal Absorptance" #> [9] " 0.7, !- Solar Absorptance" #> [10] " 0.7; !- Visible Absorptance"
# get string format of object, and decrease the space between field values and # field names mat$to_string(sep_at = 15)
#> [1] "Material," #> [2] " another_name, !- Name" #> [3] " MediumRough, !- Roughness" #> [4] " 0.019, !- Thickness {m}" #> [5] " 1.729577, !- Conductivity {W/m-K}" #> [6] " -1, !- Density {kg/m3}" #> [7] " 836.8, !- Specific Heat {J/kg-K}" #> [8] " 0.9, !- Thermal Absorptance" #> [9] " 0.7, !- Solar Absorptance" #> [10] " 0.7; !- Visible Absorptance"
# get string format of object, and decrease the leading space of field values mat$to_string(leading = 0)
#> [1] "Material," #> [2] "another_name, !- Name" #> [3] "MediumRough, !- Roughness" #> [4] "0.019, !- Thickness {m}" #> [5] "1.729577, !- Conductivity {W/m-K}" #> [6] "-1, !- Density {kg/m3}" #> [7] "836.8, !- Specific Heat {J/kg-K}" #> [8] "0.9, !- Thermal Absorptance" #> [9] "0.7, !- Solar Absorptance" #> [10] "0.7; !- Visible Absorptance"
# } ## ------------------------------------------------ ## Method `IdfObject$print` ## ------------------------------------------------ # \dontrun{ # print the object without comment mat$print(comment = FALSE)
#> <IdfObject: 'Material'> [ID:14] `another_name` #> Class: <Material> #> ├─ 1*: "another_name", !- Name #> │─ 2*: "MediumRough", !- Roughness #> │─ 3*: 0.019, !- Thickness {m} #> │─ 4*: 1.729577, !- Conductivity {W/m-K} #> │─ 5*: -1, !- Density {kg/m3} #> │─ 6*: 836.8, !- Specific Heat {J/kg-K} #> │─ 7 : 0.9, !- Thermal Absorptance #> │─ 8 : 0.7, !- Solar Absorptance #> └─ 9 : 0.7; !- Visible Absorptance
# print the object, and auto separate field values and field names at the # largetst character length of field values mat$print(auto_sep = TRUE)
#> <IdfObject: 'Material'> [ID:14] `another_name` #> Class: <Material> #> ├─ 1*: "another_name", !- Name #> │─ 2*: "MediumRough", !- Roughness #> │─ 3*: 0.019, !- Thickness {m} #> │─ 4*: 1.729577, !- Conductivity {W/m-K} #> │─ 5*: -1, !- Density {kg/m3} #> │─ 6*: 836.8, !- Specific Heat {J/kg-K} #> │─ 7 : 0.9, !- Thermal Absorptance #> │─ 8 : 0.7, !- Solar Absorptance #> └─ 9 : 0.7; !- Visible Absorptance
# }