expand_idf_dots_value: Parse object field values given in list format

View source: R/impl-idf.R

expand_idf_dots_valueR Documentation

Parse object field values given in list format

Description

Parse object field values given in list format

Usage

expand_idf_dots_value(
  idd_env,
  idf_env,
  ...,
  .type = "class",
  .complete = TRUE,
  .all = FALSE,
  .scalar = TRUE,
  .pair = FALSE,
  .ref_assign = TRUE,
  .unique = TRUE,
  .empty = TRUE,
  .default = TRUE,
  .env = parent.frame()
)

Arguments

idd_env

An environment or list contains IDD tables including class, field, and reference.

idf_env

An environment or list contains IDF tables including object, value, and reference.

...

Lists of object definitions. Each list should be named with a valid class/object id/name. ID should be denoted in style ..ID. There is a special element .comment in each list, which will be used as new comments of the object. If .ref_assign is TRUE, ⁠:=⁠ can be used to group ids/names:

  • When .type equals "class", LHS multiple class indices/names should be wrapped by .(), c().

  • When .type equals "object", LHS multiple object ids/names should be wrapped by .() or c(). LHS SINGLE class name should be wrapped by ..().

.type

Should be either "class" or "object". If "class", id/name of each input will be treated as class index/name. If "object", id/name of each input will be treated as object id/name.

.complete

If TRUE, make sure the returned field number meets the ⁠\min-fields⁠ requirement. Default: TRUE

.all

If TRUE, make sure the all possible fields are returned. Default: FALSE.

.scalar

If TRUE, make sure the value of each field in the object is a scalar value. If FALSE, value_chr and value_num column will be list type. Default: TRUE.

.pair

Only works when .scalar is FALSE. If .pair is TRUE, vector field values will be paired to each id/name on the LHS. In this case, value_chr and value_num will be character type and double type, respectively. When there is only one id/name on the LHS, it will be replicated to match the length of the value vector. Default: FALSE.

.ref_assign

If TRUE, allow using ⁠:=⁠ to gather multiple classes/objects on the LHS when defining the objects. Default: TRUE.

.unique

If TRUE, make sure there are no duplicated classes/objects in the input. Default: FALSE.

.empty

If TRUE, allow using an empty list, i.e. list() to define an object with all default values. Default: TRUE.

.default

If TRUE, all empty fields will be filled with default values if possible. Default: TRUE.

.env

An environment specifying the environment to evaluate the .... Default: parent.frame().

Value

A named list of 2 element object and value which is a data.table::data.table() with object data and value data respectively.


hongyuanjia/eplusr documentation built on Feb. 14, 2024, 5:38 a.m.