to_gadget_formula: Turn R expression into Gadget formula string

Description Usage Arguments Details Value Examples

Description

This function is stolen directly from Rgadget::to.gadget.formulae. It takes an unevaluated R expression (e.g. quote(2 + log(moo - 1))) and converts it into a character string that is readable by Gadget

Usage

1
to_gadget_formula(ex, stocknames = NULL)

Arguments

ex

An unevaluated R expression (i.e. enclosed in quotes)

stocknames

Optional. Character vector of stocknames to add to any formula variable names

Details

Gadget uses reverse Polish notation to read formulas (i.e. the operator comes first, followed by the items to be operated on; 2 + 2 is read as (+ 2 2)). This function will take an expression recognizable by R and convert it to one that is recognizable by Gadget

Value

A character vector that is readable as a Gadget formula

Examples

1
2

inspktrgadget/gadgetSim documentation built on May 10, 2019, 9:51 a.m.