IddObject {eplusr} | R Documentation |
EnergyPlus IDD object
Description
IddObject
is an abstraction of a single object in an Idd object. It
provides more detail methods to query field properties. IddObject
can only
be created from the parent Idd object, using $object()
,
$object_in_group()
and other equivalent. This is because that
initialization of an IddObject
needs some shared data from parent Idd
object.
Details
There are lots of properties for every class and field. For details on the
meaning of each property, please see the heading comments in the
Energy+.idd
file in the EnergyPlus installation path.
Methods
Public methods
Method new()
Create an IddObject
object
Usage
IddObject$new(class, parent)
Arguments
Details
Note that an IddObject
can be created from the parent Idd object,
using $object()
, idd_object and other equivalent.
Returns
An IddObject
object.
Examples
\dontrun{ surf <- IddObject$new("BuildingSurface:Detailed", use_idd(8.8, download = "auto")) }
Method version()
Get the version of parent Idd
Usage
IddObject$version()
Details
$version()
returns the version of parent Idd
in a
base::numeric_version()
format. This makes it easy to direction
compare versions of different IddObject
s, e.g. iddobj$version() > 8.6
or
iddobj1$version() > iddobj2$version()
.
Returns
A base::numeric_version()
object.
Examples
\dontrun{ # get version surf$version() }
Method parent()
Get parent Idd
Usage
IddObject$parent()
Details
$parent()
returns parent Idd object.
Returns
A Idd object.
Examples
\dontrun{ surf$parent() }
Method group_name()
Get the group name
Usage
IddObject$group_name()
Details
$group_name()
returns the group name of current IddObject
.
Returns
A single string.
Examples
\dontrun{ surf$group_name() }
Method group_index()
Get the group index
Usage
IddObject$group_index()
Details
$group_index()
returns the group index of current IddObject
. A
group index is just an integer indicating its appearance order in the
Idd.
Returns
A single integer.
Examples
\dontrun{ surf$group_index() }
Method class_name()
Get the class name of current IddObject
Usage
IddObject$class_name()
Details
$class_name()
returns the class name of current IddObject
.
Returns
A single string.
Examples
\dontrun{ surf$class_name() }
Method class_index()
Get the class index
Usage
IddObject$class_index()
Details
$class_index()
returns the class index of current IddObject
. A
class index is just an integer indicating its appearance order in the
Idd.
Returns
A single integer.
Examples
\dontrun{ surf$class_index() }
Method class_format()
Get the class format
Usage
IddObject$class_format()
Details
$class_format()
returns the format of this IDD class. This format
indicator is currently not used by eplusr.
Returns
A single character.
Examples
\dontrun{ surf$class_format() }
Method min_fields()
Get the minimum field number of current class
Usage
IddObject$min_fields()
Details
$min_fields()
returns the minimum fields required for current class.
If no required, 0
is returned.
Returns
A single integer.
Examples
\dontrun{ surf$min_fields() }
Method num_fields()
Get the total field number of current class
Usage
IddObject$num_fields()
Details
$num_fields()
returns current total number of fields in current
class.
Returns
A single integer.
Examples
\dontrun{ surf$num_fields() }
Method memo()
Get the memo string of current class
Usage
IddObject$memo()
Details
$memo()
returns memo of current class, usually a brief description
of this class.
Returns
A character vector.
Examples
\dontrun{ surf$memo() }
Method num_extensible()
Get the field number of the extensible group in current class
Usage
IddObject$num_extensible()
Details
$num_extensible()
returns the field number of the extensible group
in current class.
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.
If there is no extensible group in current class, 0
is returned.
Returns
A single integer.
Examples
\dontrun{ surf$num_extensible() }
Method first_extensible_index()
Get the minimum field number of current class
Usage
IddObject$first_extensible_index()
Details
$first_extensible_index()
returns the field index of first
extensible field in current class.
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.
If there is no extensible group in current class, 0
is returned.
Returns
A single integer.
Examples
\dontrun{ surf$first_extensible_index() }
Method extensible_group_num()
Get the number of extensible groups in current class
Usage
IddObject$extensible_group_num()
Details
$extensible_group_num()
returns the number of extensible groups in
current class.
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.
If there is no extensible group in current class, 0
is returned.
Returns
A single integer.
Examples
\dontrun{ surf$extensible_group_num() }
Method add_extensible_group()
Add extensible groups in current class
Usage
IddObject$add_extensible_group(num = 1L)
Arguments
num
An integer indicating the number of extensible groups to be added.
Details
$add_extensible_groups()
adds extensible groups in this class.
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.
An error will be issued if current class contains no extensible group.
Returns
The modified IddObject
itself.
Examples
\dontrun{ # field number before adding surf$num_fields() # extensible group number before adding surf$extensible_group_num() # add 2 more extensible groups surf$add_extensible_group(2) # field number after adding surf$num_fields() # extensible group number after adding surf$extensible_group_num() }
Method del_extensible_group()
Delete extensible groups in current class
Usage
IddObject$del_extensible_group(num = 1L)
Arguments
num
An integer indicating the number of extensible groups to be deleted.
Details
$del_extensible_groups()
deletes extensible groups in this class.
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.
An error will be issued if current class contains no extensible group.
Returns
The modified IddObject
itself.
Examples
\dontrun{ # field number before deleting surf$num_fields() # extensible group number before deleting surf$extensible_group_num() # delete 2 more extensible groups surf$del_extensible_group(2) # field number after deleting surf$num_fields() # extensible group number after deleting surf$extensible_group_num() }
Method has_name()
Check if current class has name attribute
Usage
IddObject$has_name()
Details
$has_name()
return TRUE
if current class has name attribute, and
FALSE
otherwise.
A class with name attribute means that objects in this class can have names.
Returns
A single logical value (TRUE
or FALSE
).
Examples
\dontrun{ surf$has_name() }
Method is_required()
Check if current class is required
Usage
IddObject$is_required()
Details
$is_required()
returns TRUE
if current class is required and
FALSE
otherwise.
A required class means that for any model, there should be at least
one object in this class. One example is Building
class.
Returns
A single logical value (TRUE
or FALSE
).
Examples
\dontrun{ surf$is_required() }
Method is_unique()
Check if current class is unique
Usage
IddObject$is_unique()
Details
$is_unique()
returns TRUE
if current class is unique and
FALSE
otherwise.
A unique class means that for any model, there should be at most
one object in this class. One example is Building
class.
Returns
A single logical value (TRUE
or FALSE
).
Examples
\dontrun{ surf$is_unique() }
Method is_extensible()
Check if current class is extensible
Usage
IddObject$is_extensible()
Details
$is_extensible()
returns TRUE
if current class is extensible and
FALSE
otherwise.
A extensible class means that for there are curtain number of fields in this class that can be dynamically added or deleted, such like the X, Y and Z vertices of a building surface.
Returns
A single logical value (TRUE
or FALSE
).
Examples
\dontrun{ surf$is_extensible() }
Method field_name()
Get field names
Usage
IddObject$field_name( index = NULL, unit = FALSE, in_ip = eplusr_option("view_in_ip") )
Arguments
index
An integer vector of field indices. If
NULL
, names of all fields in this class are returned. Default:NULL
.unit
If
TRUE
, the units of those fields are also returned. Default:FALSE
.in_ip
If
in_ip
, corresponding imperial units are returned. It only has effect whenunit
isTRUE
. Default:eplusr_option("view_in_ip")
.
Details
$field_name()
returns a character vector of names of fields
specified by field indices in current class.
Returns
A character vector.
Examples
\dontrun{ # get all field names surf$field_name() # get field units also surf$field_name(unit = TRUE) # get field units in IP surf$field_name(unit = TRUE) # change field name to lower-style surf$field_name(unit = TRUE, in_ip = TRUE) }
Method field_index()
Get field indices
Usage
IddObject$field_index(name = NULL)
Arguments
name
A character vector of field names. Can be in "lower-style", i.e. all spaces and dashes is replaced by underscores. If
NULL
, indices of all fields in this class are returned. Default:NULL
.
Details
$field_index()
returns an integer vector of names of fields
specified by field names in current class.
Returns
An integer vector.
Examples
\dontrun{ # get all field indices surf$field_index() # get field indices for specific fields surf$field_index(c("number of vertices", "vertex 10 z-coordinate")) }
Method field_type()
Get field types
Usage
IddObject$field_type(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$field_type()
returns a character vector of field types of
specified fields in current class. All possible values are:
-
"integer"
-
"real"
-
"alpha"
(arbitrary string) -
"choice"
(alpha with specific list of choices) -
"object-list"
(link to a list of objects defined elsewhere) -
"external-list"
(uses a special list from an external source) -
"node"
(name used in connecting HVAC components).
Returns
A character vector.
Examples
\dontrun{ # get all field types surf$field_type() # get field types for specific fields surf$field_type(c("name", "zone name", "vertex 10 z-coordinate")) }
Method field_note()
Get field notes
Usage
IddObject$field_note(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$field_note()
returns a list of character vectors that contains
field notes of specified fields in current class, usually serving as
field descriptions. If no notes are found for current fields, NULL
is returned.
Returns
A list of character vectors.
Examples
\dontrun{ # get all field notes surf$field_note() # get field types for specific fields surf$field_note(c("name", "zone name", "vertex 10 z-coordinate")) }
Method field_unit()
Get field units
Usage
IddObject$field_unit(which = NULL, in_ip = eplusr_option("view_in_ip"))
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.in_ip
If
in_ip
, corresponding imperial units are returned. Default:eplusr_option("view_in_ip")
.
Details
$field_unit()
returns a character vector that contains units of
specified fields in current class. If there is no unit found for
current field, NA
is returned.
Returns
A character vector.
Examples
\dontrun{ # get all field units surf$field_unit() # get field units for specific fields surf$field_unit(c("name", "zone name", "vertex 10 z-coordinate")) }
Method field_default()
Get field default value
Usage
IddObject$field_default(which = NULL, in_ip = eplusr_option("view_in_ip"))
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.in_ip
If
in_ip
, values in corresponding imperial units are returned. Default:eplusr_option("view_in_ip")
.
Details
$field_default()
returns a list that contains default values of
specified fields in current class. If there is no default value found
for current field, NA
is returned.
Returns
A character vector.
Examples
\dontrun{ # get all field default values surf$field_default() # get default values for specific fields surf$field_default(c("name", "zone name", "vertex 10 z-coordinate")) }
Method field_choice()
Get choices of field values
Usage
IddObject$field_choice(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$field_value()
returns a list of character vectors that contains
choices of specified field values in current class. If there is no
choice found for current field, NULL
is returned.
Returns
A list of character vectors.
Examples
\dontrun{ # get all field value choices surf$field_choice() # get field value choices for specific fields surf$field_choice(c("name", "sun exposure", "wind exposure")) }
Method field_range()
Get field value ranges
Usage
IddObject$field_range(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$field_range()
returns a list of value ranges of specified fields
in current class.
Every range has four components:
-
minimum
: lower limit -
lower_incbounds
:TRUE
if the lower limit should be included -
maximum
: upper limit -
upper_incbounds
:TRUE
if the upper limit should be included
For fields of character type,
-
minimum
andmaximum
are always set toNA
-
lower_incbounds
andupper_incbounds
are always set toFALSE
For fields of numeric types with no specified ranges,
-
minimum
is set to-Inf
-
lower_incbounds
is set toFALSE
-
upper
is set toInf
-
upper_incbounds
is set toFALSE
The field range is printed in number interval denotation.
Returns
A list of ranges.
Examples
\dontrun{ # get all field value ranges surf$field_range() # get value ranges for specific fields surf$field_range(c("name", "number of vertices", "vertex 10 z-coordinate")) }
Method field_relation()
Extract the relationship among fields
Usage
IddObject$field_relation( which = NULL, direction = c("all", "ref_by", "ref_to"), class = NULL, group = NULL, depth = 0L, keep = FALSE )
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.direction
The relation direction to extract. Should be one of
"all"
,"ref_to"
or"ref_by"
.class
A character vector of class names used for searching relations. Default:
NULL
.group
A character vector of group names used for searching relations. Default:
NULL
.depth
If > 0, the relation is searched recursively. A simple example of recursive reference: one material named
mat
is referred by a construction namedconst
, andconst
is also referred by a surface namedsurf
. IfNULL
, all possible recursive relations are returned. Default:0
.keep
If
TRUE
, all input fields are returned regardless they have any relations with other objects or not. IfFALSE
, only fields in input that have relations with other objects are returned. Default:FALSE
.
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
.
$field_relation()
provides a simple interface to get this kind of
relation. It takes a field specification and a relation
direction, and returns an IddRelation
object which contains data
presenting such relation above.
$field_relation()
returns a list of references for those fields
that have the object-list
and/or reference
and
reference-class-name
attribute. Basically, it is a list of two
elements ref_to
and ref_by
. Underneath, ref_to
and ref_by
are data.tables which contain source
field data and reference field data with custom printing method. For
instance, if iddobj$field_relation(c(1, 2), "ref_to")
gives results
below:
-- Refer to Others --------------------- +- Field: <1: Field 1> | v~~~~~~~~~~~~~~~~~~ | \- Class: <Class 2> | \- Field: <2: Field 2> | \- Field: <2: Field 2>
This means that Field 2
in current class does not refer to any other fields.
But Field 1
in current class refers to Field 2
in class named Class 2
.
Returns
An IddRelation
object.
Examples
\dontrun{ # get field relation for specific fields surf$field_relation(c("name", "zone name", "vertex 10 z-coordinate")) }
Method field_possible()
Get field possible values
Usage
IddObject$field_possible(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$field_possible()
returns all possible values for specified fields,
including auto-value (Autosize
, Autocalculate
, and NA
if not
applicable), and results from $field_default()
, $field_range()
,
$field_choice()
. Underneath, it returns a data.table with custom
printing method. For instance, if iddobj$field_possible(c(4, 2))
gives results below:
-- 4: Field 4 ---------- * Auto value: <NA> * Default: <NA> * Choice: - "Key1" - "Key2" -- 2: Field 2 ---------- * Auto value: "Autosize" * Default: 2 * Choice: <NA>
This means that Field 4
in current class cannot be "autosized" or
"autocalculated", and it does not have any default value. Its value should be
a choice from "Key1"
or "Key2"
. For Field 2
in current class, it has a
default value of 2
but can also be filled with value "Autosize"
.
Returns
A IddFieldPossible
object which is a
data.table::data.table()
with 9 columns.
Examples
\dontrun{ # get field possible values for specific fields surf$field_possible(6:10) }
Method is_valid_field_num()
Check if input is a valid field number
Usage
IddObject$is_valid_field_num(num)
Arguments
num
An integer vector to test.
Details
$is_valid_field_num()
returns TRUE
if input num
is acceptable
as a total number of fields in this class. Extensible property is
considered.
For instance, the total number of fields defined in IDD for class
BuildingSurfaces:Detailed
is 390. However, 396 is still a valid
field number for this class as the number of field in the extensible
group is 3.
Returns
A logical vector.
Examples
\dontrun{ surf$is_valid_field_num(c(10, 14, 100)) }
Method is_extensible_index()
Check if input field index indicates an extensible field
Usage
IddObject$is_extensible_index(index)
Arguments
index
An integer vector of field indices.
Details
$is_extensible_index()
returns TRUE
if input index
indicates an
index of extensible field in current class.
Extensible fields mean that these fields can be dynamically added or deleted, such like the X, Y and Z vertices of a building surface.
Returns
A logical vector.
Examples
\dontrun{ surf$is_extensible_index(c(10, 14, 100)) }
Method is_valid_field_name()
Check if input character is a valid field name
Usage
IddObject$is_valid_field_name(name, strict = FALSE)
Arguments
name
A character vector to test.
strict
If
TRUE
, only exact match is accepted. Default:FALSE
.
Details
$is_valid_field_name()
returns TRUE
if name
is a valid field
name WITHOUT unit. Note name
can be given in underscore style,
e.g. "outside_layer"
is equivalent to "Outside Layer"
.
Returns
A logical vector.
Examples
\dontrun{ surf$is_valid_field_name(c("name", "sun_exposure")) # exact match surf$is_valid_field_name(c("Name", "Sun_Exposure"), strict = TRUE) }
Method is_valid_field_index()
Check if input integer is a valid field index
Usage
IddObject$is_valid_field_index(index)
Arguments
index
An integer vector to test.
Details
$is_valid_field_index()
returns TRUE
if index
is a valid field
index. For extensible class, TRUE
is always returned.
Returns
A logical vector.
Examples
\dontrun{ surf$is_valid_field_index(1:10) }
Method is_autosizable_field()
Check if input field can be autosized
Usage
IddObject$is_autosizable_field(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$is_autosizable_field()
returns TRUE
if input field can be
assigned to autosize
.
Returns
A logical vector.
Examples
\dontrun{ surf$is_autosizable_field() surf$is_autosizable_field(c("name", "sun_exposure")) }
Method is_autocalculatable_field()
Check if input field can be autocalculated
Usage
IddObject$is_autocalculatable_field(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$is_autocalculatable_field()
returns TRUE
if input field can be
assigned to autocalculate
.
Returns
A logical vector.
Examples
\dontrun{ surf$is_autocalculatable_field() surf$is_autocalculatable_field(c("name", "sun_exposure")) }
Method is_numeric_field()
Check if input field value should be numeric
Usage
IddObject$is_numeric_field(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$is_numeric_field()
returns TRUE
if the value of input field
should be numeric ( an integer or a real number).
Returns
A logical vector.
Examples
\dontrun{ surf$is_numeric_field() surf$is_numeric_field(c("name", "sun_exposure")) }
Method is_real_field()
Check if input field value should be a real number
Usage
IddObject$is_real_field(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$is_real_field()
returns TRUE
if the field value should be a real
number but not an integer.
Returns
A logical vector.
Examples
\dontrun{ surf$is_real_field() surf$is_real_field(c("name", "number of vertices")) }
Method is_integer_field()
Check if input field value should be an integer
Usage
IddObject$is_integer_field(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$is_real_field()
returns TRUE
if the field value should be an
integer.
Returns
A logical vector.
Examples
\dontrun{ surf$is_integer_field() surf$is_integer_field(c("name", "number of vertices")) }
Method is_required_field()
Check if input field is required
Usage
IddObject$is_required_field(which = NULL)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.
Details
$is_required_field()
returns TRUE
if the field is required.
Returns
A logical vector.
Examples
\dontrun{ surf$is_required_field() surf$is_required_field(c("name", "number of vertices")) }
Method has_ref()
Check if input field can refer to or can be referred by other fields
Usage
IddObject$has_ref(which = NULL, class = NULL, group = NULL, depth = 0L)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.class
A character vector of class names used for searching relations. Default:
NULL
.group
A character vector of group names used for searching relations. Default:
NULL
.depth
If > 0, the relation is searched recursively. A simple example of recursive reference: one material named
mat
is referred by a construction namedconst
, andconst
is also referred by a surface namedsurf
. IfNULL
, all possible recursive relations are returned. Default:0
.
Details
$has_ref()
returns TRUE
if input field refers to or can be referred
by other fields.
Returns
A logical vector.
Examples
\dontrun{ surf$has_ref() surf$has_ref(c("name", "zone name")) }
Method has_ref_to()
Check if input field can refer to other fields
Usage
IddObject$has_ref_to(which = NULL, class = NULL, group = NULL, depth = 0L)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.class
A character vector of class names used for searching relations. Default:
NULL
.group
A character vector of group names used for searching relations. Default:
NULL
.depth
If > 0, the relation is searched recursively. A simple example of recursive reference: one material named
mat
is referred by a construction namedconst
, andconst
is also referred by a surface namedsurf
. IfNULL
, all possible recursive relations are returned. Default:0
.
Details
$has_ref_to()
returns TRUE
if input field can refer to other
fields.
Returns
A logical vector.
Examples
\dontrun{ surf$has_ref_to() surf$has_ref_to(c("name", "zone name")) }
Method has_ref_by()
Check if input field can be referred by other fields
Usage
IddObject$has_ref_by(which = NULL, class = NULL, group = NULL, depth = 0L)
Arguments
which
An integer vector of field indices or a character vector of field names in current class. If
NULL
, all fields in this class are used. Default:NULL
.class
A character vector of class names used for searching relations. Default:
NULL
.group
A character vector of group names used for searching relations. Default:
NULL
.depth
If > 0, the relation is searched recursively. A simple example of recursive reference: one material named
mat
is referred by a construction namedconst
, andconst
is also referred by a surface namedsurf
. IfNULL
, all possible recursive relations are returned. Default:0
.
Details
$has_ref_by()
returns TRUE
if input field can be referred by
other fields.
Returns
A logical vector.
Examples
\dontrun{ surf$has_ref_by() surf$has_ref_by(c("name", "zone name")) }
Method outputs()
Get possible output variables for current class
Usage
IddObject$outputs()
Details
$outputs()
returns a data.table that
gives all possible outputs for current class.
The returned data.table has 6 columns:
*index
: Integer. Index of each variable.
*class
: Character. Name of current class.
-
reported_time_step
: Character. Reported time step for the variables. Possible value:Zone
andHVAC
. -
report_type
: Character. Report types. Possible value:Average
,Sum
. -
variable
: Character. Report variable names. -
units
: Character. Units of reported values.NA
if report values do not have units.
Returns
A data.table with 6 columns.
Examples
\dontrun{ surf$outputs() }
Method to_table()
Format an IddObject
as a data.frame
Usage
IddObject$to_table(all = FALSE)
Arguments
all
If
TRUE
, all available fields defined in IDD for specified class will be returned. IfFALSE
, only the minimum field number is returned. Default:FALSE
.
Details
$to_table()
returns a data.table that
contains basic data of current class.
The returned data.table has 3 columns:
-
class
: Character type. Current class name. -
index
: Integer type. Field indexes. -
field
: Character type. Field names.
Returns
A data.table with 3 columns.
Examples
\dontrun{ surf$to_table() surf$to_table(TRUE) }
Method to_string()
Format an IdfObject
as a character vector
Usage
IddObject$to_string(comment = NULL, leading = 4L, sep_at = 29L, all = FALSE)
Arguments
comment
A character vector to be used as comments of returned string format object.
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 specified class will be returned. Default:FALSE
.
Details
$to_string()
returns the text format of current class. The returned
character vector can be pasted into an IDF file as an empty object of
specified class.
Returns
A character vector.
Examples
\dontrun{ # get text format of class BuildingSurface:Detailed surf$to_string() # tweak output formatting surf$to_string(leading = 0, sep_at = 0) # add comments surf$to_string(c("This", "will", "be", "comments")) }
Method print()
Print IddObject
object
Usage
IddObject$print(brief = FALSE)
Arguments
brief
If
TRUE
, only class name part is printed. Default:FALSE
.
Details
$print()
prints the IddObject
object giving the information of
class name, class properties, field indices and field names.
$print()
prints the IddObject. Basically, the print output can be
divided into 4 parts:
CLASS: IDD class name of current object in format
<IddObject: CLASS>
.MEMO: brief description of the IDD class.
PROPERTY: properties of the IDD class, including name of group it belongs to, whether it is an unique or required class and current total fields. The fields may increase if the IDD class is extensible, such as
Branch
,ZoneList
and etc.FIELDS: fields of current IDD class. Required fields are marked with stars (
*
). If the class is extensible, only the first extensible group will be printed and two ellipses will be shown at the bottom. Fields in the extensible group will be marked with an arrow down surrounded by angle brackets (<v>
).
Returns
The IddObject
object itself, invisibly.
Examples
\dontrun{ surf surf$print(brief = TRUE) }
Note
Some classes have special format when saved in the IDFEditor with the special format option enabled. Those special format includes "singleLine", "vertices", "compactSchedule", "fluidProperties", "viewFactors" and "spectral". eplusr can handle all those format when parsing IDF files. However, when saved, all classes are formatted in standard way.
This number may change if the class is extensible and after
$add_extensible_group()
or $del_extensible_group()
.
The type of each default value will be consistent with field
definition. However, for numeric fields with default values being
"autosize"
or "autocalculate"
, the type of returned values will
be character.
All outputs are extracted from the LaTeX source file of "Input Output Reference" for EnergyPlus v9.5.0 and later. So empty result will always be returned for Idd version lower than v9.5.
It is possible that there are some mistakes introduced when extracting the output variables. Also, some outputs are only available if certain fields are set. Even they are listed in the results, it does not mean that the Idf can report all of them. It is strongly suggested to check the RDD and MDD file for correctness.
Author(s)
Hongyuan Jia
See Also
Idd Class
Examples
## ------------------------------------------------
## Method `IddObject$new`
## ------------------------------------------------
## Not run:
surf <- IddObject$new("BuildingSurface:Detailed", use_idd(8.8, download = "auto"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$version`
## ------------------------------------------------
## Not run:
# get version
surf$version()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$parent`
## ------------------------------------------------
## Not run:
surf$parent()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$group_name`
## ------------------------------------------------
## Not run:
surf$group_name()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$group_index`
## ------------------------------------------------
## Not run:
surf$group_index()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$class_name`
## ------------------------------------------------
## Not run:
surf$class_name()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$class_index`
## ------------------------------------------------
## Not run:
surf$class_index()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$class_format`
## ------------------------------------------------
## Not run:
surf$class_format()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$min_fields`
## ------------------------------------------------
## Not run:
surf$min_fields()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$num_fields`
## ------------------------------------------------
## Not run:
surf$num_fields()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$memo`
## ------------------------------------------------
## Not run:
surf$memo()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$num_extensible`
## ------------------------------------------------
## Not run:
surf$num_extensible()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$first_extensible_index`
## ------------------------------------------------
## Not run:
surf$first_extensible_index()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$extensible_group_num`
## ------------------------------------------------
## Not run:
surf$extensible_group_num()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$add_extensible_group`
## ------------------------------------------------
## Not run:
# field number before adding
surf$num_fields()
# extensible group number before adding
surf$extensible_group_num()
# add 2 more extensible groups
surf$add_extensible_group(2)
# field number after adding
surf$num_fields()
# extensible group number after adding
surf$extensible_group_num()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$del_extensible_group`
## ------------------------------------------------
## Not run:
# field number before deleting
surf$num_fields()
# extensible group number before deleting
surf$extensible_group_num()
# delete 2 more extensible groups
surf$del_extensible_group(2)
# field number after deleting
surf$num_fields()
# extensible group number after deleting
surf$extensible_group_num()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$has_name`
## ------------------------------------------------
## Not run:
surf$has_name()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_required`
## ------------------------------------------------
## Not run:
surf$is_required()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_unique`
## ------------------------------------------------
## Not run:
surf$is_unique()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_extensible`
## ------------------------------------------------
## Not run:
surf$is_extensible()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_name`
## ------------------------------------------------
## Not run:
# get all field names
surf$field_name()
# get field units also
surf$field_name(unit = TRUE)
# get field units in IP
surf$field_name(unit = TRUE)
# change field name to lower-style
surf$field_name(unit = TRUE, in_ip = TRUE)
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_index`
## ------------------------------------------------
## Not run:
# get all field indices
surf$field_index()
# get field indices for specific fields
surf$field_index(c("number of vertices", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_type`
## ------------------------------------------------
## Not run:
# get all field types
surf$field_type()
# get field types for specific fields
surf$field_type(c("name", "zone name", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_note`
## ------------------------------------------------
## Not run:
# get all field notes
surf$field_note()
# get field types for specific fields
surf$field_note(c("name", "zone name", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_unit`
## ------------------------------------------------
## Not run:
# get all field units
surf$field_unit()
# get field units for specific fields
surf$field_unit(c("name", "zone name", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_default`
## ------------------------------------------------
## Not run:
# get all field default values
surf$field_default()
# get default values for specific fields
surf$field_default(c("name", "zone name", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_choice`
## ------------------------------------------------
## Not run:
# get all field value choices
surf$field_choice()
# get field value choices for specific fields
surf$field_choice(c("name", "sun exposure", "wind exposure"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_range`
## ------------------------------------------------
## Not run:
# get all field value ranges
surf$field_range()
# get value ranges for specific fields
surf$field_range(c("name", "number of vertices", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_relation`
## ------------------------------------------------
## Not run:
# get field relation for specific fields
surf$field_relation(c("name", "zone name", "vertex 10 z-coordinate"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$field_possible`
## ------------------------------------------------
## Not run:
# get field possible values for specific fields
surf$field_possible(6:10)
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_valid_field_num`
## ------------------------------------------------
## Not run:
surf$is_valid_field_num(c(10, 14, 100))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_extensible_index`
## ------------------------------------------------
## Not run:
surf$is_extensible_index(c(10, 14, 100))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_valid_field_name`
## ------------------------------------------------
## Not run:
surf$is_valid_field_name(c("name", "sun_exposure"))
# exact match
surf$is_valid_field_name(c("Name", "Sun_Exposure"), strict = TRUE)
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_valid_field_index`
## ------------------------------------------------
## Not run:
surf$is_valid_field_index(1:10)
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_autosizable_field`
## ------------------------------------------------
## Not run:
surf$is_autosizable_field()
surf$is_autosizable_field(c("name", "sun_exposure"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_autocalculatable_field`
## ------------------------------------------------
## Not run:
surf$is_autocalculatable_field()
surf$is_autocalculatable_field(c("name", "sun_exposure"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_numeric_field`
## ------------------------------------------------
## Not run:
surf$is_numeric_field()
surf$is_numeric_field(c("name", "sun_exposure"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_real_field`
## ------------------------------------------------
## Not run:
surf$is_real_field()
surf$is_real_field(c("name", "number of vertices"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_integer_field`
## ------------------------------------------------
## Not run:
surf$is_integer_field()
surf$is_integer_field(c("name", "number of vertices"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$is_required_field`
## ------------------------------------------------
## Not run:
surf$is_required_field()
surf$is_required_field(c("name", "number of vertices"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$has_ref`
## ------------------------------------------------
## Not run:
surf$has_ref()
surf$has_ref(c("name", "zone name"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$has_ref_to`
## ------------------------------------------------
## Not run:
surf$has_ref_to()
surf$has_ref_to(c("name", "zone name"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$has_ref_by`
## ------------------------------------------------
## Not run:
surf$has_ref_by()
surf$has_ref_by(c("name", "zone name"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$outputs`
## ------------------------------------------------
## Not run:
surf$outputs()
## End(Not run)
## ------------------------------------------------
## Method `IddObject$to_table`
## ------------------------------------------------
## Not run:
surf$to_table()
surf$to_table(TRUE)
## End(Not run)
## ------------------------------------------------
## Method `IddObject$to_string`
## ------------------------------------------------
## Not run:
# get text format of class BuildingSurface:Detailed
surf$to_string()
# tweak output formatting
surf$to_string(leading = 0, sep_at = 0)
# add comments
surf$to_string(c("This", "will", "be", "comments"))
## End(Not run)
## ------------------------------------------------
## Method `IddObject$print`
## ------------------------------------------------
## Not run:
surf
surf$print(brief = TRUE)
## End(Not run)