[Distr-commits] r998 - branches/distr-2.6/pkg/SweaveListingUtils/inst/try
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun May 3 06:20:38 CEST 2015
Author: stamats
Date: 2015-05-03 06:20:37 +0200 (Sun, 03 May 2015)
New Revision: 998
Added:
branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw
Removed:
branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw
Log:
Rnw file and corresponding tex file had slightly different names
Copied: branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw (from rev 996, branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw)
===================================================================
--- branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw (rev 0)
+++ branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw 2015-05-03 04:20:37 UTC (rev 998)
@@ -0,0 +1,112 @@
+ \documentclass[9pt]{beamer}
+
+\usepackage{fancyvrb}
+\usepackage{listings}
+
+% choose language and char set
+\usepackage[ngerman]{babel}
+\usepackage[ansinew]{inputenc}
+%leave \usepackage{Sweave} somewhere in a comment (like this)
+%otherwise Sweave will fill in a \usepackage{Sweave} ...
+
+\RequirePackage{color}
+% your colors in rgb coordinates (no default values so far hence in TeX):
+\definecolor{myRBackgroundColor}{rgb}{0.95, 0.85, 0.5}
+\definecolor{myRKeywordColor}{rgb}{0.2, 0.5, 0.8}
+\definecolor{myRRecKeywordColor}{rgb}{0.5, 0.5, 0.5}
+\definecolor{myRIntKeywordColor}{rgb}{0.3, 0.5, 0.5}
+
+\SweaveOpts{prefix.string=Routput/parcel, keep.source=TRUE}
+
+<<SweaveListingPreparations,results=tex, echo=FALSE>>=
+require(SweaveListingUtils)
+#
+# define keywordstyles (in R code!):
+kws <- "{\\color{myRKeywordColor}}"
+kws.rec <- "{\\color{myRRecKeywordColor}}"
+kws.int <- "{\\color{myRIntKeywordColor}}"
+#
+# frame definition:
+myRFrameOn <- list("backgroundcolor"="\\color{myRBackgroundColor}",
+ "frame"="single", "framerule"="0pt")
+myRFrameOff <- list("backgroundcolor"="\\color{white}",
+ "frame"="none")
+
+# setting keywordstyles
+SweaveListingoptions(Keywordstyle = kws,
+ Recomd.Keywordstyle = kws.rec,
+ interm.Keywordstyle = kws.int)
+#
+# append background color in Rset - style:
+myRset <- getSweaveListingOption("Rset")
+myRset$"keywordstyle" <- kws
+#
+SweaveListingPreparations(Rcommentcolor = c(0.1,0.1,0.3),
+ Rcolor = c(0.6,0.4,0.4),
+ Routcolor = c(0.1,0.6,0.1),
+ Rset = myRset
+ # your colors in rgb coordinates
+ #(colors already defined in SweaveListingUtils, hence in R)
+ )
+lstsetRin(c(myRFrameOn,"keywordstyle"=kws),add=TRUE)
+lstsetRout(c(myRFrameOn,"keywordstyle"=kws),add=TRUE)
+@
+
+
+\begin{document}
+
+
+\begin{frame}[fragile,allowframebreaks]
+\frametitle{Your title}
+
+<<tey0,results=tex, echo=FALSE>>=
+require(Hmisc)
+@
+
+<<tey>>=
+options(digits=3, prompt="R> ")
+set.seed(1)
+
+require(Hmisc)
+
+age <- rnorm(1000,50,10)
+print(str(age))
+sex <- sample(c('female','male'),1000,TRUE)
+out <- histbackback(split(age, sex), probability=TRUE,
+ xlim=c(-.06,.06), main = 'Back to Back Histogram')
+
+#! just adding color
+barplot(-out$left, col="red" , horiz=TRUE, space=0,
+ add=TRUE, axes=FALSE)
+barplot(out$right, col="blue", horiz=TRUE, space=0,
+ add=TRUE, axes=FALSE)
+@
+
+
+and here I write some {\sf R}-code: \code{rnorm(3)}
+(setting background color in inline code does not work however.)
+
+\framebreak
+To switch of background color also for (all sorts of) S-chunks, use
+<<changeStyle, results=tex, echo=FALSE>>=
+lstsetRall(myRFrameOff,add=TRUE)
+@
+
+
+<<tey2>>=
+options(digits=4)
+set.seed(1)
+age <- rnorm(1000,50,10)
+str(age)
+@
+
+\end{frame}
+
+<<end,results=TeX,echo=FALSE>>=
+ options(prompt=">",digits=6)
+ unloadNamespace("SweaveListingUtils")
+@
+
+\end{document}
+
+%%%%% end example
Deleted: branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw
===================================================================
--- branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw 2015-05-03 04:13:07 UTC (rev 997)
+++ branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw 2015-05-03 04:20:37 UTC (rev 998)
@@ -1,112 +0,0 @@
- \documentclass[9pt]{beamer}
-
-\usepackage{fancyvrb}
-\usepackage{listings}
-
-% choose language and char set
-\usepackage[ngerman]{babel}
-\usepackage[ansinew]{inputenc}
-%leave \usepackage{Sweave} somewhere in a comment (like this)
-%otherwise Sweave will fill in a \usepackage{Sweave} ...
-
-\RequirePackage{color}
-% your colors in rgb coordinates (no default values so far hence in TeX):
-\definecolor{myRBackgroundColor}{rgb}{0.95, 0.85, 0.5}
-\definecolor{myRKeywordColor}{rgb}{0.2, 0.5, 0.8}
-\definecolor{myRRecKeywordColor}{rgb}{0.5, 0.5, 0.5}
-\definecolor{myRIntKeywordColor}{rgb}{0.3, 0.5, 0.5}
-
-\SweaveOpts{prefix.string=Routput/parcel, keep.source=TRUE}
-
-<<SweaveListingPreparations,results=tex, echo=FALSE>>=
-require(SweaveListingUtils)
-#
-# define keywordstyles (in R code!):
-kws <- "{\\color{myRKeywordColor}}"
-kws.rec <- "{\\color{myRRecKeywordColor}}"
-kws.int <- "{\\color{myRIntKeywordColor}}"
-#
-# frame definition:
-myRFrameOn <- list("backgroundcolor"="\\color{myRBackgroundColor}",
- "frame"="single", "framerule"="0pt")
-myRFrameOff <- list("backgroundcolor"="\\color{white}",
- "frame"="none")
-
-# setting keywordstyles
-SweaveListingoptions(Keywordstyle = kws,
- Recomd.Keywordstyle = kws.rec,
- interm.Keywordstyle = kws.int)
-#
-# append background color in Rset - style:
-myRset <- getSweaveListingOption("Rset")
-myRset$"keywordstyle" <- kws
-#
-SweaveListingPreparations(Rcommentcolor = c(0.1,0.1,0.3),
- Rcolor = c(0.6,0.4,0.4),
- Routcolor = c(0.1,0.6,0.1),
- Rset = myRset
- # your colors in rgb coordinates
- #(colors already defined in SweaveListingUtils, hence in R)
- )
-lstsetRin(c(myRFrameOn,"keywordstyle"=kws),add=TRUE)
-lstsetRout(c(myRFrameOn,"keywordstyle"=kws),add=TRUE)
-@
-
-
-\begin{document}
-
-
-\begin{frame}[fragile,allowframebreaks]
-\frametitle{Your title}
-
-<<tey0,results=tex, echo=FALSE>>=
-require(Hmisc)
-@
-
-<<tey>>=
-options(digits=3, prompt="R> ")
-set.seed(1)
-
-require(Hmisc)
-
-age <- rnorm(1000,50,10)
-print(str(age))
-sex <- sample(c('female','male'),1000,TRUE)
-out <- histbackback(split(age, sex), probability=TRUE,
- xlim=c(-.06,.06), main = 'Back to Back Histogram')
-
-#! just adding color
-barplot(-out$left, col="red" , horiz=TRUE, space=0,
- add=TRUE, axes=FALSE)
-barplot(out$right, col="blue", horiz=TRUE, space=0,
- add=TRUE, axes=FALSE)
-@
-
-
-and here I write some {\sf R}-code: \code{rnorm(3)}
-(setting background color in inline code does not work however.)
-
-\framebreak
-To switch of background color also for (all sorts of) S-chunks, use
-<<changeStyle, results=tex, echo=FALSE>>=
-lstsetRall(myRFrameOff,add=TRUE)
-@
-
-
-<<tey2>>=
-options(digits=4)
-set.seed(1)
-age <- rnorm(1000,50,10)
-str(age)
-@
-
-\end{frame}
-
-<<end,results=TeX,echo=FALSE>>=
- options(prompt=">",digits=6)
- unloadNamespace("SweaveListingUtils")
-@
-
-\end{document}
-
-%%%%% end example
More information about the Distr-commits
mailing list