Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add R language support #121

Closed
dmpe opened this issue Dec 25, 2017 · 6 comments
Closed

add R language support #121

dmpe opened this issue Dec 25, 2017 · 6 comments

Comments

@dmpe
Copy link

dmpe commented Dec 25, 2017

Join me in 👍 this issue

@gpoore
Copy link
Owner

gpoore commented Dec 25, 2017

Can you provide a little detail about why you're interested in R support, in spite of what already exists in Sweave and knitr? What do you see R support providing that hasn't already been done better elsewhere?

@EmmanuelCharpentier
Copy link

I'm looking around to find complements/alternatives to SageTeX. PythonTeX seems interesting, but I have not (yet) experiment it.

My interest has ben aroused by this issue. I happen to be an (applied) statistician), whho has to use R (intensely) and Sage (sometimes). In my current setup, compiling a docume,nt involves :

emacs foo.Rnw --> knitr --> LaTeX --> (LaTeX -->) --> Sage --> LaTeX (--> LaTeX)

Emacs' AUCTeX, Rnw-mode and sage_shell_mode are of great help, but a more streamlined workflow would be welcome.

  • Support for R in PythonTeX would probably allow that.
  • An alternative might be (persistent) Sage and python engines in knitr.
  • Bonus : SageTeX's makestatic is currently broken, and not easily fixed. depythontex might come in handy...
  • Potential drawback : knitr's cache and depends features are extremely handy, and really useful when working with modern techniques using resampling and/or MCMC, which may be unreasonably chronophage... I do not know yet how well PyhonTeX will behave in that aspect.

HTH,

@dmpe
Copy link
Author

dmpe commented Feb 2, 2018

@gpoore sorry for replying very late. The problem I have faced was that my primary document was in latex (not in Rnw/knitr/whatever else - just pure latex) and I needed ability to insert R code without going into Rnw/knitr route.
Not a problem anymore though but still nice to have feature

@gpoore
Copy link
Owner

gpoore commented Oct 20, 2018

I've added basic support for R. It is enabled via \usepackage[usefamily=R]{pythontex}. This provides \R, \Rc and Rcode, \Rb and Rblock, and \Rv and Rverbatim.

There isn't an Rconsole yet. I'm thinking that a good first approximation might be to put commands in a file commands.R with options(echo=TRUE), and process that with Rscript. I'd be open to any suggestions on processing commands to get results equivalent to an interactive session.

@dmpe
Copy link
Author

dmpe commented Oct 20, 2018

hi, thank you ver much.
your idea sounds good - go ahead with that from my side

@EmmanuelCharpentier
Copy link

I didn't see the comment about the Oct 23, 2018.

If I understand correctly, that means that Pythontex's support for R is essentially complete. Great !

Thank you a lot for this work. This alernative to knitr comes very handy when using a mixed-bag of languages (I tend to use Sagemath more and more...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants