man-roxygen/class_container_constructor.R

# class_container_constructor.R


# Always merged with class_container.R.


#' @param x conceptually, any \R object. Typically, a `character`, a
#' [`data.frame`][base::data.frame()],
#' a [`data.table`][data.table::data.table()] or a [`Schema`][Schema-class].
#' See details. If missing, an empty object is initialized.
#'
#' @param schema a [`Schema`][Schema-class] object. If `x` is itself an object
#' of class [`Schema`][Schema-class], it should be missing (it is ignored).
#'
#' @param ... further arguments passed to or from other methods:
#'
#' * if `x` is a character, `...` is passed to [safe_read_csv()];
#' * if `x` is a [`data.frame`][base::data.frame()] or an object of class
#' [`Schema`][Schema-class], `...` is passed to [data.table::as.data.table()].
#'
#' @return
#' The constructor function [Container()] returns an object of class `Container`.
#'
#' @details
#' If a [`Schema`][Schema-class] object is passed to [Container()], an empty
#' `Container` is generated. It will have empty columns defined with names
#' and types matching the underlying [`Schema`][Schema-class]. Argument `schema`
#' is ignored for that special case.
jeanmathieupotvin/cargo documentation built on Oct. 27, 2020, 5:22 p.m.