1
$\begingroup$

I am R user and very new to mathematica. I want to make run a .wl file into R script and using its results into the same R script. Is there any possible way to load and run .wl file into R?

Your help will be much appreciated.

Thank You

$\endgroup$
3
$\begingroup$

I am not aware of any links between R and Mathematica that allow evaluating Mathematica code directly from within R.

The reverse, i.e. evaluating R code from within Mathematica, and using its result, is possible using RLink.

What you can do is call the command line version of Mathematica as a separate process from R, the same way you would run a Mathematica script from a terminal, then parse its output as a string. How to best do this in R is a question for an R forum.

To make parsing the output easier, you should encode it into a format that R can read directly. What formats can be used depends also on the nature of the output, but for simple numerical tables CSV may be useful, and for more complex structures look at JSON.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.