man-roxygen/class_schema_extractors.R

# class_schema_extractors.R


#' @name Schema-extractors
#'
#' @title
#' Schema: extract parts of a Schema object
#'
#' @description
#' Usual operators to subset and manipulate an object of class
#' [`Schema`][Schema-class].
#'
#' @param x an object of class [`Schema`][Schema-class].
#' @param i indices specifying **tags** to extract. Indices can be `logical`,
#' `numeric` or `character` vectors. If missing, `x` is returned. Numeric
#' values are coerced to integer by [as.integer()] (and hence truncated towards
#' zero). Character vectors will be matched partially to tags and can be
#' abbreviated. If `i` is longer than `x`, the non-relevent components of `i`
#' are ignored.
#' @param name a `name`.
#'
#' @return
#' Exractors are all *endomorphism*: they return an object (possibly empty) of
#' class [`Schema`][Schema-class] in all cases. An exception is made for
#' operator `$` which returns `NULL` if `name` is not found. This is for
#' consistency with other list-like objects.
#'
#' @family Schema
jeanmathieupotvin/cargo documentation built on Oct. 27, 2020, 5:22 p.m.