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
##################################################################### | |
# Created by Scott Chamberlain | |
# Ecology and Evolutionary Biology Dept., Rice University | |
# Houston, TX 77005, USA | |
# [email protected] | |
##################################################################### | |
# Function to split confidence intervals, this function is required in the below functions | |
CI_split <- function(a){ | |
dd<-c(gsub("\\(","",unlist(strsplit(a[5],","))[1]),gsub("\\)","",unlist(strsplit(a[5],","))[2])) |
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[a4paper]{article} | |
\SweaveOpts{echo=FALSE, keep.source=TRUE} | |
\usepackage{a4wide} | |
\usepackage{color} | |
\usepackage{hyperref} | |
\begin{document} | |
\section{Example of self-documenting data journalism notes} | |
This is an example of using Sweave to combine code and output from the R statistical programming environment and the LaTeX document processing environment to generate a self-documenting script in which the actual code used to do stats and generate statistical graphics is displayed along the charts it directly produces. |
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
%!TEX TS-program = xelatex | |
%!TEX encoding = UTF-8 Unicode | |
%% Copyright 2011 Markus Gesmann | |
\documentclass[a4paper]{article} | |
\usepackage[noae,nogin]{Sweave} | |
\usepackage{tikz} | |
%% attachfile2 is patched to work with xelatex |
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
## title:First Attempt at a knitr Performance Report | |
## author:Timely Portfolio | |
require(PerformanceAnalytics) | |
require(xtable) | |
data(edhec) | |
table.CalendarReturns(edhec[,1:3])[13:15] | |
charts.PerformanceSummary(edhec[,1:3], | |
colorset=c("gray50","steelblue2","steelblue4"), |
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
require(knitr) | |
knit2pdf("performance summary.rnw") |
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{beamer} | |
\usetheme{Singapore} | |
\usepackage{tipa} | |
%% Make the r-code small | |
\ifdefined\knitrout | |
\renewenvironment{knitrout}{\begin{footnotesize}}{\end{footnotesize}} | |
\else | |
\fi |
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
require(quantmod) | |
require(ggplot2) | |
require(reshape2) | |
require(plyr) | |
require(scales) | |
# Download some Data, e.g. the CBOE VIX | |
getSymbols("^VIX",src="yahoo") | |
# Make a dataframe |
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
%% LyX 2.0.2 created this file. For more info, see http://www.lyx.org/. | |
%% Do not edit unless you really know what you are doing. | |
\documentclass[english,nohyper,noae]{tufte-handout} | |
\usepackage{helvet} | |
\usepackage[T1]{fontenc} | |
\usepackage[latin9]{inputenc} | |
\usepackage{babel} | |
\usepackage[unicode=true,pdfusetitle, | |
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1, | |
breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=false] |
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
%% LyX 2.0.2 created this file. For more info, see http://www.lyx.org/. | |
%% Do not edit unless you really know what you are doing. | |
\documentclass[english,nohyper,noae]{tufte-handout} | |
\usepackage{helvet} | |
\usepackage[T1]{fontenc} | |
\usepackage[latin9]{inputenc} | |
\usepackage{babel} | |
\usepackage[unicode=true,pdfusetitle, | |
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1, | |
breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=false] |
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
require(ggplot2) | |
require(grid) | |
theme_update(panel.background=theme_blank(), | |
panel.grid.major=theme_blank(), | |
panel.border=theme_blank()) | |
#Borrowed (i.e. stollen) from http://research.stowers-institute.org/efg/R/Color/Chart/ColorChart.R | |
getColorHexAndDecimal <- function(color) { | |
if(is.na(color)) { |
OlderNewer