[R] R: Including R plots in a Microsoft Word document
Greetings List, I am conducting some large simulations using R. As a result, I get many plots but I'm having some trouble with including some of them in a Microsoft Word document. Can any one tell me the easiest method of having copies of the R-graphs in the Word documents? Best regards Mahmoud [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R: Including R plots in a Microsoft Word document
Hello, I first would like to thank all of you for your great ideas. However, I agree with Paul particularly in that the answer is more complicated than other people make it seem when you have many graphs. I am trying all the ideas. It seems that all of them work but with some difficulties. I have Windows 2000 and MS Office 200. It seems to me that the easiest way of solving the problem is through saving the file in Bmp or Jpeg format and edit it in a graphic program such as Photoshop then insert it in the file. I will continue trying all methods to find the easiest. Best regards Mahmoud - Original Message - From: Paul Johnson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 20, 2004 9:47 PM Subject: Re: [R] R: Including R plots in a Microsoft Word document I have wrestled with this problem a lot. I use Linux, coauthors use Windows, and the eps files I make from R don't work with MS Word. Well, the don't ever have previews and they sometimes won't print at all when I use CrossOver Office with MS Office 2000 in Linux. My coauthor says he can often wrestle my eps files into word on his system with Office 2003. People keep telling me to use gsview to insert the preview panes into eps files, and that does work, but more than one half of the time my system creates eps files that look significantly worse than the originals. Sometimes it inserts a blank page at the top of the eps or it reshapes a figure. I don't care enough about MS to try to track that down. It just pisses me off. As a result, I think the answer is more complicated than other people make it seem. I don't think it does any good to output a pdf file because, as I learned yesterday, MS Word users can't import a pdf file into a doc. Clearly, if you are an MS windows user of R, you can save graphics in the windows meta format (wmf) (or is it enhanced meta format, emf?). That will go more or less seamlessly into Word. If you have a chance to boot into Windows, and you really must make an image that works well with Word, then you should boot into Windows, run your R in there and make the wmf file. If you are a Linux/Unix user, and you are too proud to use Windows, the problem is much more difficult to deal with. If you are ABSOLUTELY SURE that your image does not need to be resized in any way, you could output from R into a picture type format, such as png. As long as the image does not need to resized in any way, that will be fine. If it is resized, then all bets are off. I find that the R output to the xfig format is quite good and I can edit files in xfig. You can edit those files, add text, so its very very handy. So right now I'm looking for a good bridge from xfig format to Word. But I just started investigating that. [EMAIL PROTECTED] wrote: On Fri, Feb 20, 2004 at 05:54:33PM +0200, Mahmoud K. Okasha wrote: Greetings List, I am conducting some large simulations using R. As a result, I get many plots but I'm having some trouble with including some of them in a Microsoft Word document. Can any one tell me the easiest method of having copies of the R-graphs in the Word documents? R can produce at least PostScript, PDF, png, jpeg/jpg see: help(postscript) help(pdf) help(png) help(jpeg) I don't use word, for me the PostScript format (more precisely Encapsulated PostScript/.eps) is the best/more easy/powerful format if you don't have thousands of points or lines :-) por instance, to print a simple plot: postscript(file=somefile.eps); plot(whatever); dev.off(); Important other formats are similar regards Ulisses Debian GNU/Linux: a dream come true --- -- Computers are useless. They can only give answers.Pablo Picasso Humans are slow, innaccurate, and brilliant. Computers are fast, acurrate, and dumb. Together they are unbeatable --- Visita http://www.valux.org/ para saber acerca de la --- --- Asociación Valenciana de Usuarios de Linux --- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Paul E. Johnson email: [EMAIL PROTECTED] Dept. of Political Sciencehttp://lark.cc.ku.edu/~pauljohn 1541 Lilac Lane, Rm 504 University of Kansas Office: (785) 864-9086 Lawrence, Kansas 66044-3177 FAX: (785) 864-5700 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read
Re: [R] R: Including R plots in a Microsoft Word document
Greetings, Thank you Gabor for your great explanation. I feel ok with it. Best regards.. Mahmoud . - Original Message - From: Gabor Grothendieck [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, February 21, 2004 2:04 AM Subject: Re: [R] R: Including R plots in a Microsoft Word document Perhaps some additional explanation is in order. There are two basic classes of format: - vector graphics such as windows metafile (wmf) and svg where the actual structure of the drawing is stored.Editing these can be done with no loss of resolution and you can access the individual components of the plot, the titles, the points, etc. directly. - bitmapped (also called raster) graphics such as jpg and png where the drawing is stored as a sequence of pixels. You can't access the individual objects in a plot with raster graphics since the image is just a set of pixels. Resizing involves a loss of resolution. Windows metafiles are the preferred format for Word. They are vector graphics, not raster, and they can be edited from within Word directly -- you don't need another editing program. This should be much easier than using bmp or jpg together with Photoshop. You can either generate wmf files by right clicking the plot and copying to the clipboard or using R code like this: win.metafile(/myfile.wmf) plot(1:10) dev.off() followed by Insert | Picture | File in Word. In Paul's case he is generating his images in Linux, where I gather Windows metafiles are not available, but in your case everything is on Windows so you should not have that problem. --- Date: Sat, 21 Feb 2004 00:38:37 +0200 From: Mahmoud K. Okasha [EMAIL PROTECTED] [ Add to Address Book | Block Address | Report as Spam ] To: Paul Johnson [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: [R] R: Including R plots in a Microsoft Word document Hello, I first would like to thank all of you for your great ideas. However, I agree with Paul particularly in that the answer is more complicated than other people make it seem when you have many graphs. I am trying all the ideas. It seems that all of them work but with some difficulties. I have Windows 2000 and MS Office 200. It seems to me that the easiest way of solving the problem is through saving the file in Bmp or Jpeg format and edit it in a graphic program such as Photoshop then insert it in the file. I will continue trying all methods to find the easiest. Best regards Mahmoud - Original Message - From: Paul Johnson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 20, 2004 9:47 PM Subject: Re: [R] R: Including R plots in a Microsoft Word document I have wrestled with this problem a lot. I use Linux, coauthors use Windows, and the eps files I make from R don't work with MS Word. Well, the don't ever have previews and they sometimes won't print at all when I use CrossOver Office with MS Office 2000 in Linux. My coauthor says he can often wrestle my eps files into word on his system with Office 2003. People keep telling me to use gsview to insert the preview panes into eps files, and that does work, but more than one half of the time my system creates eps files that look significantly worse than the originals. Sometimes it inserts a blank page at the top of the eps or it reshapes a figure. I don't care enough about MS to try to track that down. It just pisses me off. As a result, I think the answer is more complicated than other people make it seem. I don't think it does any good to output a pdf file because, as I learned yesterday, MS Word users can't import a pdf file into a doc. Clearly, if you are an MS windows user of R, you can save graphics in the windows meta format (wmf) (or is it enhanced meta format, emf?). That will go more or less seamlessly into Word. If you have a chance to boot into Windows, and you really must make an image that works well with Word, then you should boot into Windows, run your R in there and make the wmf file. If you are a Linux/Unix user, and you are too proud to use Windows, the problem is much more difficult to deal with. If you are ABSOLUTELY SURE that your image does not need to be resized in any way, you could output from R into a picture type format, such as png. As long as the image does not need to resized in any way, that will be fine. If it is resized, then all bets are off. I find that the R output to the xfig format is quite good and I can edit files in xfig. You can edit those files, add text, so its very very handy. So right now I'm looking for a good bridge from xfig format to Word. But I just started investigating that. [EMAIL PROTECTED] wrote: On Fri, Feb 20, 2004 at 05:54:33PM +0200, Mahmoud K. Okasha wrote: Greetings List, I am conducting some large simulations using R. As a result, I get many plots but I'm
Re: R for economists (was: [R] Almost Ideal Demand System)
Hello, I know a few papers in economics and econometrics using R. One of them in the Journal of Applied Econometrics. You may have a look at the following link: http://netec.mcc.ac.uk/WoPEc/data/Articles/jaejapmetv:14:y:1999:i:3:p:319-29 .html or you could download the paper from the R-project site: http://www.r-project.org/nocvs/papers/Cribari-Neto+Zarkos:1999.pdf Best regards - Original Message - From: Arne Henningsen [EMAIL PROTECTED] To: Ajay Shah [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, February 19, 2004 3:26 PM Subject: R for economists (was: [R] Almost Ideal Demand System) Hi, I did not find any web page about using R in economics and econometrics so far. However, this does not mean that there is none (searching with google for R and economics gives many pages about economics and a name like Firstname R. Lastname on it ;-)). Does anybody in the list does know such a web page? If not, I will be happy if you, Ajay, could build and maintaine one. Best wishes, Arne On Sunday 15 February 2004 07:31, Ajay Shah wrote: Anne, Please do make progress on packaging and releasing your R code for demand analysis. Is there a web page titled R for economists! :-) If there isn't, I'll be happy to build and maintain one, and put a link to your code there. -- Arne Henningsen Department of Agricultural Economics University of Kiel Olshausenstr. 40 D-24098 Kiel (Germany) Tel: +49-431-880 4445 Fax: +49-431-880 1397 [EMAIL PROTECTED] http://www.uni-kiel.de/agrarpol/ahenningsen/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Generating 2x2 contingency tables
Hi again, Thank you. I solved my problem by sampling from the multinomial distribution.. Best regards ... - Original Message - From: Torsten Hothorn [EMAIL PROTECTED] To: Mahmoud K. Okasha [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 9:30 AM Subject: Re: [R] Generating 2x2 contingency tables On Tue, 17 Feb 2004, Mahmoud K. Okasha wrote: Hello R-users, I would like to generate two-way contingency tables with zero in one cell. I tried to use the function r2dtable but I could not force one cell to have zero value. r2dtable samples from the conditional distribution of the table given the margins. And with margins fixed AND one cell fixed (to zero) the conditional distribution just puts mass one at the observed table. You may want to sample from a multinomial distribution with one of the parameters fixed to zero. Best, Torsten Any Idea? Best regards.. Mahmoud [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] boostrapping at R
Hi, After reading your data you can use functions such as : bts - numeric (500) for (i in 1:500) bts[i] - sample(yourdata, replace=TRUE) Regards - Original Message - From: Ricardo Huaman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 10:59 PM Subject: [R] boostrapping at R Friends: How can I do boostrapping at R? Thanks Ricardo. [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] citation() doesn´t work
No, I have just used it. the result is: citation() To cite R in publications, use R Development Core Team (2003). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-00-3, URL http://www.R-project.org. We have invested a lot of effort in creating R, please cite it when using it for data analysis. A BibTeX entry for LaTeX users is @Manual{, title= {R: A language and environment for statistical computing}, author = {{R Development Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = 2003, note = {ISBN 3-900051-00-3}, url = {http://www.R-project.org} } Best regards... - Original Message - From: Prof Brian Ripley [EMAIL PROTECTED] To: Kenneth Cabrera [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, February 17, 2004 2:51 PM Subject: Re: [R] citation() doesn´t work On Tue, 17 Feb 2004, Kenneth Cabrera wrote: Hi R users: I want to know if you have the same problem with the citation() function, it doesn´t work! So, what exactly happens on your system? I get citation() To cite R in publications, use on R-1.8.1 under Windows. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Generating 2x2 contingency tables
Hello R-users, I would like to generate two-way contingency tables with zero in one cell. I tried to use the function r2dtable but I could not force one cell to have zero value. Any Idea? Best regards.. Mahmoud [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Apply a function to each cell of a ragged matrix
Hi, you could simply use functions such as: time - dim (3) for ( i in 1:3) time [i] - x[i,1]+x[i,2] the result of time will be the sum of rows. best regards.. - Original Message - From: XIAO LIU [EMAIL PROTECTED] To: R Help [EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 12:38 AM Subject: [R] Apply a function to each cell of a ragged matrix R-Helpers: There are a matrix x and a factor f. nrow(x) == length(f), e.g.: x - matrix(1:6, nrow = 3) f - factor(c(daytime, daytime, night)) I want the sum of all elements of rows of x for each corresponding level in factor f, In this case, I want output like: daytime [1] x[1,1]+x[2,1]+x[1,2]+x[2,2] night [2] x[3,1]+x[3,2] But, tapply(x,f,sum) or by(x,f,sum) do not work. What other functions can I use? Thank you very much Xiao __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html