Created
June 20, 2011 18:10
-
-
Save cameronbracken/1036173 to your computer and use it in GitHub Desktop.
pgfSweave example file for concordance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{Sweave} | |
\usepackage{tikz} | |
\SweaveOpts{keep.source=TRUE,tidy=TRUE,concordance=TRUE} | |
\begin{document} | |
<<>>= | |
# Small function with highlight=TRUE and tidy=TRUE and some additional garbage....... | |
# garbage to see how it wraps. | |
@ | |
<<>>= | |
cip <- function(x=10, n=100, conf.level=0.95){phat <- x/n; z <- qnorm(1-(1 - conf.level)/2); SE <- sqrt(phat*(1-phat)/n); ME <- z*SE; c(phat-ME, phat+ME)} # cip function | |
@ | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
script to compile: