knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(nomnoml) library(DiagrammeR)
The raison d'étre of the {arcana}
package ...
The {arcana}
package was developed as an extension of the formula
class in base R. The {vctrs}
package was used to extend the approach to formula handling.
These are some of the thoughts that led to the development of this package.
formula
class, as it applies to modeling and relationship descriptionsmtcars$cyl ~ "Number of Cylinders"
)As {vctrs}
forms the base for this, a key concept is the idea of vector types and coercion hierarchy.
DiagrammeR::grViz("digraph { graph [layout = dot, rankdir = BT] node [shape = plaintext, fontname = arial] edge [color = rosybrown] # Terms { rank=same ch [label = <<b>CHARACTER</b>>] ls [label = label] rl [label = role] } tx [label = <<b>TERM</b>>, fontcolor = crimson] tl [label = <<b>TERM LIST</b>>, fontcolor = crimson] # Formulas fx [label = <<b>FORMULA</b>>, fontcolor = crimson] pt [label = pattern] fl [label = <<b>FORMULA LIST</b>>, fontcolor = crimson] # Models mx [label = <<b>MODEL</b>>] ml [label = <<b>MODEL LIST</b>>, fontcolor = crimson] df [label = 'data'] # Relationships subgraph skeleton{ ch -> tx tx -> ch tx -> tl tl -> tx tl -> fx fx -> tl fx -> mx [weight = 0] fx -> fl [weight = 2] fl -> ml [weight = 2] mx -> ml [weight = 0] } ls -> tx [arrowhead = empty, weight = 0] rl -> tx [arrowhead = empty, weight = 0] pt -> fl [arrowhead = empty] df -> mx [arrowhead = empty] df -> ml [arrowhead = empty] }")
In theory, the character
class is considered enriched as a term
class. In turn, a term
class is considered enriched as a formula
class. These enriched classes of term and formula could be implemented as vectors under this type of hierarchy, with emergent properties/attributes that develop in the hierarchy.
DiagrammeR::grViz(" digraph { # Graph graph [layout = dot, rankdir = RL] # Nodes of object classes term [shape = record, label='Term Record|+character|+side'] }")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.