Title: | Translate R Regression Model Formulae to 'Julia' Syntax |
---|---|
Description: | Metaprogramming utilities for converting R regression model formulae to equivalents in 'Julia' <doi:10.1137/141000671>, via modifications to the abstract syntax tree. Supports translations in zero correlation random effects syntax, protection of expressions to be evaluated as-is, interaction terms, and more. Accepts strings or R formula objects and returns modified R formula objects where possible (or a modified string, if not a valid formula in R). |
Authors: | June Choe [aut, cre] |
Maintainer: | June Choe <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-21 04:35:27 UTC |
Source: | https://github.com/yjunechoe/JuliaFormulae |
Utilities for formula random effects structure
has_bars(x, type = c("both", "single", "double")) find_bars(x) no_bars(x)
has_bars(x, type = c("both", "single", "double")) find_bars(x) no_bars(x)
x |
A formula object |
type |
One of |
A modified formula object
has_bars(y ~ x) has_bars(y ~ x + (x | g)) has_bars(y ~ x + (x | g), type = "double") find_bars(y ~ x) find_bars(y ~ x + (x | g)) no_bars(y ~ x) no_bars(y ~ x + (x | g))
has_bars(y ~ x) has_bars(y ~ x + (x | g)) has_bars(y ~ x + (x | g), type = "double") find_bars(y ~ x) find_bars(y ~ x + (x | g)) no_bars(y ~ x) no_bars(y ~ x + (x | g))
Convert R formula to Julia syntax
julia_formula(x)
julia_formula(x)
x |
A formula object |
A Julia-compatible formula object
julia_formula(y ~ a) julia_formula(y ~ a + I(a ^ 2) + (a || b))
julia_formula(y ~ a) julia_formula(y ~ a + I(a ^ 2) + (a || b))