construct: Construct/deconstruct between objects and data frames

Description Usage Arguments

View source: R/construct.R

Description

This function is designed to translate between data frame structures from flat files or databases into the objects.

Outside of a full ORM solution, this is best for just mapping S3, S4, and R6 classes to databases with the goal of recreating them in some other session.

Usage

1
2
3
construct(data, defn, ...)

deconstruct(objs, defn, ...)

Arguments

data

(tbl) data frame object where each row is object data

defn

(opt) class definition

  • character - reference to an S4 class, function, or R6 class generator

  • S4 class - S4 objects are expected

  • R6 class - R6 objects are expected

  • function - functions that generate S3 classes are expected

...

(arg) method-specific arguments

objs

(lst) list of objects conforming to that the class defn.


tjpalanca/dbtools documentation built on Oct. 7, 2021, 6:43 a.m.