From 4d548eb47286d8d24f16e11c2c77a4524a415647 Mon Sep 17 00:00:00 2001 From: Karthik Ram Date: Wed, 31 Jul 2013 20:53:05 -0700 Subject: [PATCH] Fixed knitting by replacing breaking characters for time being. --- ggplot.Rnw | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ggplot.Rnw b/ggplot.Rnw index 48e58c2..d961434 100644 --- a/ggplot.Rnw +++ b/ggplot.Rnw @@ -15,8 +15,13 @@ opts_chunk$set(cache=TRUE, message=FALSE) # smaller font size for chunks opts_chunk$set(size = 'footnotesize') options(width = 60) +knit_hooks$set(inline = function(x) { + if (is.numeric(x)) return(knitr:::format_sci(x, 'latex')) + knitr:::hi_latex(x) +}) @ + % -------------------------------------------------------------- \begin{document} \title{Data Visualization with R \& ggplot2} @@ -583,7 +588,7 @@ library(ggthemes) my_custom_plot <- function(df, title = "", ...) { ggplot(df, ...) + ggtitle(title) + - whatever geoms() + + whatever_geoms() + theme(...) } @ @@ -605,11 +610,11 @@ plot1 <- my_custom_plot(dataset1, title = "Figure 1") \begin{frame}[fragile] \frametitle{Commonly used scales} <>= -scale_fill_discrete(), scale_colour_discrete() -scale_fill_hue(), scale_color_hue() -scale_fill_manual(), scale_color_manual() -scale_fill_brewer(), scale_color_brewer() -scale_linetype(), scale_shape_manual() +scale_fill_discrete(); scale_colour_discrete() +scale_fill_hue(); scale_color_hue() +scale_fill_manual(); scale_color_manual() +scale_fill_brewer(); scale_color_brewer() +scale_linetype(); scale_shape_manual() @ \end{frame}