sagemath / sagecell

The Sage Cell Server---providing a way to embed Sage computations into any web page.
Other
201 stars 70 forks source link

R markdown in sagecell ? #532

Open jpcaveiro opened 4 years ago

jpcaveiro commented 4 years ago

The output of R in sagecell is complex to manage. I cannot predict what is going to be shown in the output and the solution is to divide R code in several cells with "sagecell" witch is not uniform.

Maybe r markdown with output to HTML is a solution (eventually a link to a PDF).

Is this possible? Is difficult to do?

novoselt commented 4 years ago

Of course it is possible, but I imagine will take quite a bit of work in SageMathCell setting and it may not be a feasible approach. All R code in SageMathCell is sent as a string through a Sage process and the output is obtained back as a string as well. There is some extra code that automatically shows autogenerated plots, but that's it. For complicated output, you are free to explicitly save it as PDF in the CWD and SageMathCell should provide a link to this file after execution of the code.