Description Usage Arguments Details Value Examples
Convert Mathematica to R
1 |
path |
Path to file to convert |
... |
Arguments to change, listed in vector format as |
For each argument in ...
, replaces x1 with x2 using gsub. This is done sequentially,
following the order of parameters in ...
. For example, c(" ","*"),c("x1","x\[1\]")
changes
" " to "*" and then "x1" to "x[1]". Special characters must be escaped.
Returns the corrected equations using
1 2 3 4 5 6 7 8 9 10 | ## Not run:
eqns <- MM2R(path="mathematica/unconfined_eqns.txt", g1=c(" ","*"), g1=c("Sqrt","sqrt"))
sink("./mathematica/unconfined_nl_eqns_R.txt")
eqns <- MM2R(path="mathematica/unconfined_nl_eqns.txt",g1=c(" ","*"),g2=c("Sqrt","sqrt"),
g3=c("Log","log"),g4=c("\\[","\\("),g5=c("\\]","\\)"),g6=c("x1","x\\[1\\]"),
g6=c("x2","x\\[2\\]"))
sink()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.