I am looking for a gentle introduction to SWEAVE, and would appreciate recommendations. I have an R program that I want to run and have the output and plots in one document. I believe this can be accomplished with SWEAVE. Unfortunately I don't know HTML, but am willing to learn. . . as I said I need a gentle introduction to SWEAVE. Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
> On Nov 17, 2015, at 9:21 AM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote: > > I am looking for a gentle introduction to SWEAVE, and would appreciate recommendations. > I have an R program that I want to run and have the output and plots in one document. I believe this can be accomplished with SWEAVE. Unfortunately I don't know HTML, but am willing to learn. . . as I said I need a gentle introduction to SWEAVE. > Thank you, > John >John, A couple of initial comments. First, you will likely get some recommendations to also consider using Knitr: http://yihui.name/knitr/ which I do not use myself (I use Sweave), but to be fair, is worth considering as an alternative. Second, to create stand alone documents, as opposed to web based content, you will likely want the output to be in TeX/LaTeX via Sweave, which can then become PDF based documents via the post processing of the TeX/LaTeX source. That is what I do for all of my analytic deliverables. You can also use LaTeX classes like 'Beamer' to create Powerpoint-like slides for presentation. Fritz' web site for Sweave is here: http://www.statistik.lmu.de/~leisch/Sweave/ and there are some links to supporting materials there with very basic examples. Another resource is: https://beckmw.files.wordpress.com/2014/02/sweave_intro1.pdf and if you Google for Sweave Introductions and Tutorials, there are a myriad of others. In conjunction with Sweave itself, there are a variety of supporting packages on CRAN that have related functionality (e.g. formatted LaTeX output) that are worth knowing about and are included in the Reproducible Research task view: https://cran.r-project.org/web/views/ReproducibleResearch.html Regards, Marc Schwartz
I suggest using knitr instead of sweave. There are plenty of tutorials online; http://jeromyanglim.blogspot.co.nz/2012/05/getting-started-with-r-markdown-knitr.html?m=1 might be a good place to start. Links to a full length book and other resources are available at http://yihui.name/knitr/ Best, Ista On Nov 17, 2015 10:23 AM, "John Sorkin" <jsorkin at grecc.umaryland.edu> wrote:> I am looking for a gentle introduction to SWEAVE, and would appreciate > recommendations. > I have an R program that I want to run and have the output and plots in > one document. I believe this can be accomplished with SWEAVE. Unfortunately > I don't know HTML, but am willing to learn. . . as I said I need a gentle > introduction to SWEAVE. > Thank you, > John > > > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:16}}
Given that you like a gentle introduction and don't know HTML, I would recommend rmarkdown in combination with knitr. See http://rmarkdown.rstudio.com/ for a lot of information. I find knitr more flexible than sweave. Markdown syntax is much easier than HTML or latex. Best regards, Thierry Op 17-nov.-2015 16:25 schreef "John Sorkin" <jsorkin at grecc.umaryland.edu>:> I am looking for a gentle introduction to SWEAVE, and would appreciate > recommendations. > I have an R program that I want to run and have the output and plots in > one document. I believe this can be accomplished with SWEAVE. Unfortunately > I don't know HTML, but am willing to learn. . . as I said I need a gentle > introduction to SWEAVE. > Thank you, > John > > > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:16}}
I've been very pleased using knitr in combination with LyX for pdf production. John Kane Kingston ON Canada> -----Original Message----- > From: jsorkin at grecc.umaryland.edu > Sent: Tue, 17 Nov 2015 10:21:15 -0500 > To: r-help at r-project.org > Subject: [R] SWEAVE - a gentle introduction > > I am looking for a gentle introduction to SWEAVE, and would appreciate > recommendations. > I have an R program that I want to run and have the output and plots in > one document. I believe this can be accomplished with SWEAVE. > Unfortunately I don't know HTML, but am willing to learn. . . as I said I > need a gentle introduction to SWEAVE. > Thank you, > John > > > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:17}}
On 17/11/2015 10:42 AM, Marc Schwartz wrote:> >> On Nov 17, 2015, at 9:21 AM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote: >> >> I am looking for a gentle introduction to SWEAVE, and would appreciate recommendations. >> I have an R program that I want to run and have the output and plots in one document. I believe this can be accomplished with SWEAVE. Unfortunately I don't know HTML, but am willing to learn. . . as I said I need a gentle introduction to SWEAVE. >> Thank you, >> John >> > > > John, > > A couple of initial comments. > > First, you will likely get some recommendations to also consider using Knitr: > > http://yihui.name/knitr/ > > which I do not use myself (I use Sweave), but to be fair, is worth considering as an alternative.He did, and I'd agree with them. I've switched to knitr for all new projects and some old ones. knitr should be thought of as Sweave version 2. Duncan Murdoch> > Second, to create stand alone documents, as opposed to web based content, you will likely want the output to be in TeX/LaTeX via Sweave, which can then become PDF based documents via the post processing of the TeX/LaTeX source. That is what I do for all of my analytic deliverables. You can also use LaTeX classes like 'Beamer' to create Powerpoint-like slides for presentation. > > Fritz' web site for Sweave is here: > > http://www.statistik.lmu.de/~leisch/Sweave/ > > and there are some links to supporting materials there with very basic examples. > > Another resource is: > > https://beckmw.files.wordpress.com/2014/02/sweave_intro1.pdf > > and if you Google for Sweave Introductions and Tutorials, there are a myriad of others. > > In conjunction with Sweave itself, there are a variety of supporting packages on CRAN that have related functionality (e.g. formatted LaTeX output) that are worth knowing about and are included in the Reproducible Research task view: > > https://cran.r-project.org/web/views/ReproducibleResearch.html > > Regards, > > Marc Schwartz > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
John, One additional point that I have not seen brought up yet. If your main goal is to have all the output from an existing R script put into a single output file then you should look at the `stitch` function in the knitr package. This will take an existing R script and convert it to one of the formats that knitr can process, then processes it for you without you needing to modify the script or learn any of the markdown (LaTeX or HTML or other). You do not have a lot of control over how the output looks, but it is quick and easy. For the long run I would suggest learning to use the full power of knitr, but stitch (and the related spin function which gives a few more options) is a quick way to process an existing script. On Tue, Nov 17, 2015 at 8:21 AM, John Sorkin <jsorkin at grecc.umaryland.edu> wrote:> I am looking for a gentle introduction to SWEAVE, and would appreciate recommendations. > I have an R program that I want to run and have the output and plots in one document. I believe this can be accomplished with SWEAVE. Unfortunately I don't know HTML, but am willing to learn. . . as I said I need a gentle introduction to SWEAVE. > Thank you, > John > > > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:18}}