Showing posts with label sweave. Show all posts
Showing posts with label sweave. Show all posts

Monday, May 20, 2013

Another option for R/LaTeX/Sweave editor

WinEdt is another good option for R/LaTeX/Sweave editing. I especially the feature of running "knitr + pdflatex" without opening a R terminal. Unfortunately it is a Windows-only software.

Wednesday, November 28, 2012

Knitr, Rstudio, and TikZ

I did not realize that this is such a powerful combination until today. It makes it possible to directly work on a Sweave file that has both text and code in the same document quite attractive (as opposed to begin an R program and a LaTeX file, then combine them together in the end).

Wednesday, April 28, 2010

Sweave vs. pgfSweave

I think pgfSweave should replace the default of Sweave system because it brings significant improvements over the original Sweave. I certain have made it my default Sweave tool on my system.

------------------------------- EDITED ON MAY 1, 2010 --------------------------------------

Since StatET made Sweaving so simple and easy, I don't have incentive to work directly on LaTeX documents any more. It is actually much simpler and more intuitive to work directly on a Sweave documents and see results in the final PDF output.

Friday, April 23, 2010

Trouble with ESS and Sweave

Last time I tried to sweave a document from with Emacs+ESS, I was using an earlier version of ESS (the current version is 5.8), and things seemed to be fine. Today when I tried to sweave a simple document and produced PDF output, I got error message of ".pdf": exited abnormally with code 2". I posted a message to the ESS mailing list, but so far no solutions have been reported. 


Here is a very simple .Rnw file I used to reproduce the error: 

---------------------------------------
\documentclass[12pt]{article}

%\usepackage{tikz}
%\usepackage{fullpage}
\usepackage{Sweave}

\begin{document}

This document outlines the analysis to be carried out to look at the
relationship between prenatal famine exposure and fetal loss risk.

\end{document}
-----------------------------------------
Before this can be fixed, I will rely on Eclipse for all my sweaving. 
---------------- April 26 ------------------------
Here is my own solution: 

from line 177 of ess-svy.el:

-      (shell-command (concat -       (if (and ess-microsoft-p (w32-shell-dos-semantics)) -           "start \"" pdfviewer "\" \"" namestem ".pdf\"" -                 "\"" pdfviewer "\" \"" namestem ".pdf\" &")))) +      (shell-command (concat
+                 "\"" pdfviewer "\" \"" namestem ".pdf\"")))

Tuesday, February 23, 2010

Friday, February 12, 2010

Sweave and LaTeX

This page contains some useful tips and links.

Friday, October 16, 2009

Syntax for sweave.sh

"Sweave.sh -otld -c file.Rnw" will compile the Rnw file, create a PDF file, and open it automatically.

The optimal way to do sweave

The optimal way to do sweave may be to have a master file in LaTeX, and a separate Rnw file contains all the computations, figures, and tables. That way, it is easy to compile the LaTeX as the writing goes on without the hassle of carrying out the computations (especially when some of them are heavy) every time.

When the computations are finished, one can simply include the generated LaTeX output in the master LaTeX file to get the complete manuscript. Here are the files:
  1. master.tex: the master LaTeX file that contains text materials of a paper;
  2. tables.Rnw: the sweave file for creating all the tables;
  3. tables.tex: the LaTeX output file that can be included in the master file;
  4. figure.Rnw: the sweave file for creating all the figures;
  5. figure.tex: the LaTeX output file that can be included in the master file;
  6. driver.tex: a simple LaTeX driver to view the tables and figures before including them into the master LaTeX file.

Thursday, August 06, 2009

CacheSweave

I finally figured out how to use the R package "cachesweave". The trick is that the code chunks must follow some order, like the following:
-----------------------------------------------------------
<setup>=
setCacheDir("testcache")
@

<first>=
library(Zelig)
library(memisc)
@
...
------------------------------------------------------------

Wednesday, August 05, 2009

Report tool

The R package "reporttools" looks promising. It generate various kinds of descriptive tables, including two-way tabulations, in LaTeX that is suitable for directly inserting into a Sweave document.

Tuesday, August 04, 2009

The foundations of statistics: A simulation-based approach

A complete book with the source code (Sweave) on-line:
http://www.ling.uni-potsdam.de/~vasishth/SFLS.html

Saturday, July 25, 2009

Work with the cachSweave package

This blog explains how to work with the R package "cacheSweave" to save time by forgo some of the time consuming computations while using Sweave:
  • http://ggorjan.blogspot.com/2008/11/sweavesh-plays-with-cachesweave.html
  • http://ggorjan.blogspot.com/2009/04/sweavesh-update.html

Saturday, January 12, 2008

Some reference on Sweave, R, and literate programming

  1. http://www.bepress.com/cgi/viewcontent.cgi?article=1148&context=jhubiostat
  2. http://www.kieranhealy.org/files/misc/workflow-apps.pdf
  3. http://epub.wu-wien.ac.at/dyn/virlib/wp/eng/mediate/epub-wu-01_c75.pdf?ID=epub-wu-01_c75
  4. To be continued...

Monday, December 31, 2007

odfWeave

The idea underlying Sweave is very appealing: you can compose a complete research paper with equations, tables, figures without manual intervention (copy, paste, adjust margin, etc.).

The package "odfWeave" extends this idea from LaTeX to OpenOffice. I just gave it a test-drive, and it rocks!

Counter