Translate R Regression Model Formulae to 'Julia' Syntax

Metaprogramming utilities for converting R regression model formulae to equivalents in 'Julia' , 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).


JuliaFormulae

Lifecycle:experimental R-CMD-check Codecov testcoverage

A utility package for converting R regression model formula to Julia GLM.jl and MixedModels.jl syntax.

See {jlme} for an example application.

Installation

# install.packages("devtools")
devtools::install_github("yjunechoe/JuliaFormulae")
library(JuliaFormulae)

Supported conversions

  • Zero correlation:

    julia_formula(y ~ x + (x || g))
    #> y ~ x + zerocorr(x | g)
    
  • Protection:

    julia_formula(y ~ x + I(x * 2))
    #> y ~ x + protect(x * 2)
    
  • Interaction terms:

    julia_formula(y ~ a:b)
    #> y ~ a & b
    

Example

julia_formula(
  y ~ a + I(a * 2) + b + a:b  + (a || g) + (b | g)
)
#> y ~ a + protect(a * 2) + b + (a & b) + zerocorr(a | g) + (b | 
#>     g)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("JuliaFormulae")

0.1.0 by June Choe, 2 years ago


Browse source code at https://github.com/cran/JuliaFormulae


Authors: June Choe [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports rrapply, stats, utils

Suggests testthat


Imported by jlmerclusterperm.


See at CRAN