parse_dots_value: Parse object field values given in list format

View source: R/impl-idf.R

parse_dots_valueR Documentation

Parse object field values given in list format

Description

Parse object field values given in list format

Usage

parse_dots_value(
  ...,
  .scalar = TRUE,
  .pair = FALSE,
  .ref_assign = TRUE,
  .unique = FALSE,
  .empty = FALSE,
  .env = parent.frame()
)

Arguments

...

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 ..().

.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.

.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.


eplusr documentation built on Aug. 25, 2023, 5:18 p.m.