Package 'JuliaFormulae'

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

Help Index


Utilities for formula random effects structure

Description

Utilities for formula random effects structure

Usage

has_bars(x, type = c("both", "single", "double"))

find_bars(x)

no_bars(x)

Arguments

x

A formula object

type

One of "both", "single", or "double". Defaults to "both".

Value

A modified formula object

Examples

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

Description

Convert R formula to Julia syntax

Usage

julia_formula(x)

Arguments

x

A formula object

Value

A Julia-compatible formula object

Examples

julia_formula(y ~ a)

julia_formula(y ~ a + I(a ^ 2) + (a || b))