Hi,
all three R bundles (R, R Console (Rdaemon), R Console (R.app)) are now uploaded to macromates' svn repository (Review trunk).
- to install them simply delete them using the Bundle Editor and restart TM. - have a look at http://wiki.macromates.com/Main/SubversionCheckout for details how to checkout - an example script export LC_CTYPE=en_US.UTF-8 mkdir -p ~/Library/Application\ Support/TextMate/Bundles cd ~/Library/Application\ Support/TextMate/Bundles svn co 'http://macromates.com/svn/Bundles/trunk/Review/Bundles/R Console (R_app).tmbundle' svn co 'http://macromates.com/svn/Bundles/trunk/Review/Bundles/R Console (Rdaemon).tmbundle' svn co 'http://macromates.com/svn/Bundles/trunk/Review/Bundles/ R.tmbundle'
- reload Bundles
Changes: 1) R - web search for the current word using RSeek.org - if Rdaemon runs Send Doc/Selection to Rdaemon simply sends the code to R without opening console.Rcon
2) Rdaemon - starts faster - Graphic Manager (prototype) opt+apple+G 1 If one has opened several graphic devices (x11, png, quartz, etc.) the Graphic Manager will display previews of all devices (not yet for pdf() or postscript() and the original devices are still open). One can click on a preview to set it to the current device, one can close a device (or all), and one can save a device as pdf, eps or as 150 dpi png, jpeg, tiff, pict, bmp, gif, sgi, jpeg 2000, tga, psd in color or as grayscale. The preview by itself is a pdf, thus one can drag&drop it to a location. (Feedback is highly welcomed!) - second syntax highlighting "Plain" to suppress the highlighting of R's output - and some minor fixes
Have fun,
Hans
Le 17 mars 08 à 10:28, Hans-Joerg Bibiko a écrit :
Hi,
all three R bundles (R, R Console (Rdaemon), R Console (R.app)) are now uploaded to macromates' svn repository (Review trunk).
Hi
I would like to know if it is possible to work with R and LaTeX.
I would like from LaTeX, give instructions to create a file(txt) from R and then make an input of this file.
I can realize this with maxima, gnuplot, giac but I don't know enough R .... :(
Best Regards
Alain Matthes
If I understand you correctly, have a look at Sweave:
http://www.stat.umn.edu/~charlie/Sweave/ http://www.ci.tuwien.ac.at/~leisch/Sweave/
On Mar 17, 2008, at 6:45 AM, Alain Matthes wrote:
Le 17 mars 08 à 10:28, Hans-Joerg Bibiko a écrit :
Hi,
all three R bundles (R, R Console (Rdaemon), R Console (R.app)) are now uploaded to macromates' svn repository (Review trunk).
Hi
I would like to know if it is possible to work with R and LaTeX.
I would like from LaTeX, give instructions to create a file(txt) from R and then make an input of this file.
I can realize this with maxima, gnuplot, giac but I don't know enough R .... :(
Best Regards
Alain Matthes
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 17 Mar 2008, at 12:14, Charilaos Skiadas wrote:
If I understand you correctly, have a look at Sweave:
http://www.stat.umn.edu/~charlie/Sweave/ http://www.ci.tuwien.ac.at/~leisch/Sweave/
On Mar 17, 2008, at 6:45 AM, Alain Matthes wrote:
I would like to know if it is possible to work with R and LaTeX.
I would like from LaTeX, give instructions to create a file(txt) from R and then make an input of this file.
I can realize this with maxima, gnuplot, giac but I don't know enough R .... :(
Or for simple things write the R code within the latex doc, select it, and invoke "R > Execute Selection/Document in R and > Insert Result".
see screencast http://www.bibiko.de/TM_R_latex_ex01.mov (2MB)
Cheers,
--Hans
Le 17 mars 08 à 12:40, Hans-Joerg Bibiko a écrit :
On 17 Mar 2008, at 12:14, Charilaos Skiadas wrote:
If I understand you correctly, have a look at Sweave:
http://www.stat.umn.edu/~charlie/Sweave/ http://www.ci.tuwien.ac.at/~leisch/Sweave/
Haris, thanks for this answer but I found Sweave too complex ( I discover R and Sweave recently , perhaps in a few days this tool will be very fine for me) My idea is to make a latex package to create interactivity between R and pgf, like gnuplot and pgf.
On Mar 17, 2008, at 6:45 AM, Alain Matthes wrote:
I would like to know if it is possible to work with R and LaTeX.
I would like from LaTeX, give instructions to create a file(txt) from R and then make an input of this file.
I can realize this with maxima, gnuplot, giac but I don't know enough R .... :(
Or for simple things write the R code within the latex doc, select it, and invoke "R > Execute Selection/Document in R and > Insert Result".
see screencast http://www.bibiko.de/TM_R_latex_ex01.mov (2MB)
Hans, this very interesting. Thanks for your work. Do you have other examples of simple things?
Best Regards
Alain Matthes
On Mar 17, 2008, at 9:03 AM, Alain Matthes wrote:
Le 17 mars 08 à 12:40, Hans-Joerg Bibiko a écrit :
On 17 Mar 2008, at 12:14, Charilaos Skiadas wrote:
If I understand you correctly, have a look at Sweave:
http://www.stat.umn.edu/~charlie/Sweave/ http://www.ci.tuwien.ac.at/~leisch/Sweave/
Haris, thanks for this answer but I found Sweave too complex ( I discover R and Sweave recently , perhaps in a few days this tool will be very fine for me) My idea is to make a latex package to create interactivity between R and pgf, like gnuplot and pgf.
Actually it is not that complex at all! I'll send you offline the midterm I just created for my students, so that you can see an example.
There has been some talk of a driver that would allow converting R graphs to pgf, but there isn't one created yet. It would be a good project for a student, I think.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 17 Mar 2008, at 14:03, Alain Matthes wrote:
On 17 Mar 2008, at 12:14, Charilaos Skiadas wrote:
If I understand you correctly, have a look at Sweave:
http://www.stat.umn.edu/~charlie/Sweave/ http://www.ci.tuwien.ac.at/~leisch/Sweave/
Haris, thanks for this answer but I found Sweave too complex ( I discover R and Sweave recently , perhaps in a few days this tool will be very fine for me) My idea is to make a latex package to create interactivity between R and pgf, like gnuplot and pgf.
What do you mean with "interactivity"? Can you give an example?
On the other hand Sweave is not too complex.
A good starting point is to download the file http://www.stat.umn.edu/~charlie/Sweave/foo.Rnw
Save that file as foo.Rnw in a new empty folder. Open that file in TM. TM sets the language to SWeave. Press APPLE+R. That's it. E.g. you will see the plots embedded in your PDF etc. Afterwards you can play with the Rnw source code. (The SWeave bundle will create a tex file foo.tex out of foo.Rnw.)
--Hans
On Mar 17, 2008, at 9:34 AM, Hans-Joerg Bibiko wrote:
Save that file as foo.Rnw in a new empty folder. Open that file in TM. TM sets the language to SWeave. Press APPLE+R. That's it. E.g. you will see the plots embedded in your PDF etc. Afterwards you can play with the Rnw source code. (The SWeave bundle will create a tex file foo.tex out of foo.Rnw.)
I've been meaning to fix that: The sweave bundle will not typeset the tex file, only create it. We need to somehow get it to call the LaTeX typesetting code once it's done the first compiling.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
ONLY A FAST THOUGHT IDEA!
SWeaving is a very nice workaround. But sometimes you only want to draw some simple things like
plot(x <- sort(rnorm(47)), type = "s", ylab="foo") points(x, cex = 1, col = "dark red")
or whatever.
Within a latex doc one could write it like this:
% plot(x <- sort(rnorm(47)), type = "s", ylab="foo") % points(x, cex = 1, col = "dark red")
to comment out the R code and to be able to redo it if needed.
Then select this R code, invoke R > Run Selection/Document in R (it should be rewritten to ignore the leading "% " if it's invoked out of a latex doc). You will get the plot shown as PDF inside of the Rmate window. Then simply drag and drop that plot to the latex doc after the R code which produced it. The latex bundle drag&drop (DD) command "Include Image" should be fine-tuned in such a way that if TM_DROPPED_FILEPATH begins with "file:///tmp/TM_R/" it popups a dialog to enter a new name for this plot. The variable "filename" of the DD command will be reset to the new file name. The actual PDF stored in tmp/TM_R will be copied into the folder of the latex doc with the new name, and after it the DD command works as usual.
Of course, one could pass the name or path of the plot in beforehand like: %% name="figure1" % plot(x <- sort(rnorm(47)), type = "s", ylab="foo") % points(x, cex = 1, col = "dark red")
I do not know if this is worth to implement? [BTW Please note, I don't want to reinvent SWeave ;)] Any Comments?
Cheers,
--Hans
Le 17 mars 08 à 16:11, Hans-Joerg Bibiko a écrit :
ONLY A FAST THOUGHT IDEA!
SWeaving is a very nice workaround. But sometimes you only want to draw some simple things like
plot(x <- sort(rnorm(47)), type = "s", ylab="foo") points(x, cex = 1, col = "dark red")
or whatever.
Within a latex doc one could write it like this:
% plot(x <- sort(rnorm(47)), type = "s", ylab="foo") % points(x, cex = 1, col = "dark red")
to comment out the R code and to be able to redo it if needed.
Then select this R code, invoke R > Run Selection/Document in R (it should be rewritten to ignore the leading "% " if it's invoked out of a latex doc). You will get the plot shown as PDF inside of the Rmate window. Then simply drag and drop that plot to the latex doc after the R code which produced it. The latex bundle drag&drop (DD) command "Include Image" should be fine-tuned in such a way that if TM_DROPPED_FILEPATH begins with "file:///tmp/TM_R/ " it popups a dialog to enter a new name for this plot. The variable "filename" of the DD command will be reset to the new file name. The actual PDF stored in tmp/TM_R will be copied into the folder of the latex doc with the new name, and after it the DD command works as usual.
Of course, one could pass the name or path of the plot in beforehand like: %% name="figure1" % plot(x <- sort(rnorm(47)), type = "s", ylab="foo") % points(x, cex = 1, col = "dark red")
I do not know if this is worth to implement? [BTW Please note, I don't want to reinvent SWeave ;)] Any Comments?
Yes this idea is fine but I want something different because I have my personnal statistic package made with pgf/tikz and I want only some results from R.
The plots are built with my package.
example : a list of n numbers (e1;....;en) with R, I get min max , quantiles
and with my package I draw a Tukey Box. min Q1 med Q3 max \whbox{0.06,0.14,0.33,0.58,0.79}
Perhaps this is possible with your bundle
Best Regards
Alain
Le 17 mars 08 à 14:34, Hans-Joerg Bibiko a écrit :
On 17 Mar 2008, at 14:03, Alain Matthes wrote:
On 17 Mar 2008, at 12:14, Charilaos Skiadas wrote:
If I understand you correctly, have a look at Sweave:
http://www.stat.umn.edu/~charlie/Sweave/ http://www.ci.tuwien.ac.at/~leisch/Sweave/
Haris, thanks for this answer but I found Sweave too complex ( I discover R and Sweave recently , perhaps in a few days this tool will be very fine for me) My idea is to make a latex package to create interactivity between R and pgf, like gnuplot and pgf.
What do you mean with "interactivity"? Can you give an example?
The idea is to use a package like gnuplottex.sty but for R
\begin{R} code with R \end{R}
The code goes in a file and execute by R Then it's possible to use the results of R with a data file like pgf and gnuplot or perhaps to use directly the results
I need to look at your work and to discover R and Sweave.
On the other hand Sweave is not too complex.
A good starting point is to download the file http://www.stat.umn.edu/~charlie/Sweave/foo.Rnw
Save that file as foo.Rnw in a new empty folder. Open that file in TM. TM sets the language to SWeave. Press APPLE+R. That's it. E.g. you will see the plots embedded in your PDF etc. Afterwards you can play with the Rnw source code. (The SWeave bundle will create a tex file foo.tex out of foo.Rnw.)
Thanks for your help. I discover at this moment, the Sweave bundle !!
It's very awesome to work with TM and all the people around it.
Best Regards
Alain Matthes