Skip to content

Commit

Permalink
dd
Browse files Browse the repository at this point in the history
  • Loading branch information
mindymallory committed Apr 29, 2016
1 parent 3feb310 commit 5becd3e
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 13 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,53 @@ libraries that will be used by later code chunks.
load('analysis-output/results.Rda')
```

A Note About Latex Styles and the YAML Header
=============================================

Getting the pandoc default latex and the latex style you prefer to work
can be a little tricky. In the root directory of this repository there
is a file called `style-headers.md` This contains a few complete YAML
headers that should work if you copy and paste them to replace the
current manuscript's YAML header.

Collaborating with Microsoft Word Users
=======================================

Many of us have colleagues who expect to recieve and be welcomed to edit
Microsoft Word documents. Fortunately, reproducability can be
maintained. With the `manuscript-example.Rmd` file open, notice that the
`knit PDF` button is actually a drop down menu and `knit Word` is an
option. If you click it, it will return to you a Microsoft Word document
that you can deliver to your colleague or professor.

They can be formatted with a .docx template. See the 'Style Reference\`
description on
[this](http://rmarkdown.rstudio.com/word_document_format.html) page.
Using the template will keep you having to format the whole thing every
time you update your colleagues and professors.

You might have noticed that there is also a `tablesandfigures.Rmd` file
in the root directory. This is for users who will need to produce Word
documents. I have found no clean way to produce decently formatted
tables and figures in Word using this method. I recommend keeping tables
and figures in a separate docuemnt that you always render as a PDF, and
a separate file for the manuscript text.

Equations are still a problem. Latex is ignored by pandoc when producing
Word documents so you will have to replace your equations. See [Iguana
Tex](http://www.jonathanleroux.org/software/iguanatex/) for the ability
to conver latex equations to pictures that can be pasted into the Word
document.

Starting Your Own Reproducable Project
======================================

Once you understand how all the peices fit together you can modify these
files to conduct your own reproducable project. Just make sure your
`data-raw` is accessed by your analysis scripts and that your results
are stored in the `anlaysis-output` folder. Then make sure your
manuscript pulls the data and analysis results automatically.

References
==========

Expand Down
16 changes: 16 additions & 0 deletions README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,22 @@ In the opening code chunk, we specify that we want to load the results from the
source('data-raw/fetch-raw-data.R')
load('analysis-output/results.Rda')
```
# A Note About Latex Styles and the YAML Header

Getting the pandoc default latex and the latex style you prefer to work can be a little tricky. In the root directory of this repository there is a file called `style-headers.md` This contains a few complete YAML headers that should work if you copy and paste them to replace the current manuscript's YAML header.

# Collaborating with Microsoft Word Users

Many of us have colleagues who expect to recieve and be welcomed to edit Microsoft Word documents. Fortunately, reproducability can be maintained. With the `manuscript-example.Rmd` file open, notice that the `knit PDF` button is actually a drop down menu and `knit Word` is an option. If you click it, it will return to you a Microsoft Word document that you can deliver to your colleague or professor.

They can be formatted with a .docx template. See the 'Style Reference` description on [this](http://rmarkdown.rstudio.com/word_document_format.html) page. Using the template will keep you having to format the whole thing every time you update your colleagues and professors.

You might have noticed that there is also a `tablesandfigures.Rmd` file in the root directory. This is for users who will need to produce Word documents. I have found no clean way to produce decently formatted tables and figures in Word using this method. I recommend keeping tables and figures in a separate docuemnt that you always render as a PDF, and a separate file for the manuscript text.

Equations are still a problem. Latex is ignored by pandoc when producing Word documents so you will have to replace your equations. See [Iguana Tex](http://www.jonathanleroux.org/software/iguanatex/) for the ability to conver latex equations to pictures that can be pasted into the Word document.

# Starting Your Own Reproducable Project

Once you understand how all the peices fit together you can modify these files to conduct your own reproducable project. Just make sure your `data-raw` is accessed by your analysis scripts and that your results are stored in the `anlaysis-output` folder. Then make sure your manuscript pulls the data and analysis results automatically.

# References
Binary file modified manuscript-example.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions style-headers.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@

# Plain Working Paper

```
---
title: "A Very Serious Analysis of the Stationarity of Corn and Soybean Prices"
author: "Peter Economist, Paul Economist, Mary Economist"
date: '`r format(Sys.time(), "%B %d, %Y")`'
output:
pdf_document:
fig_caption: yes
header-includes: \usepackage{setspace} \doublespacing
bibliography: bibliography.bib
---
```

# AJAE

```
Expand Down
34 changes: 21 additions & 13 deletions tablesandfigures-example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,32 @@ documentclass: ajae
bibliography: bibliography.bib
---

# Tables and Figures

```{r, echo=FALSE, warning = FALSE, message = FALSE, comment = NA}
load('analysis-output/results.Rda')
```{r, warning = FALSE, message = FALSE, echo=FALSE}
library(xtable)
library(vars)
summary(var_model)
library(ggplot2)
library(ggfortify)
library(gridExtra)
source('data-raw/fetch-raw-data.R')
load('analysis-output/results.Rda')
```


# Tables and Figures

```{r, echo=FALSE, warning = FALSE, message = FALSE, fig.cap = 'Diganostics' }
```{r, echo=FALSE, warning = FALSE, message = FALSE, results = "asis"}
t = list()
t[[1]] <- xtable(adf[[1]]@testreg, caption = "ADF Results for Corn")
t[[2]] <- xtable(adf[[2]]@testreg, caption = "ADF Results for Soybeans")
print.xtable(t[[1]], caption.placement = 'top', comment = FALSE)
```

plot(stability(var_model), nc = 2)
```{r, echo=FALSE, warning = FALSE, message = FALSE, results = "asis"}
print.xtable(t[[2]], caption.placement = 'top', comment = FALSE)
```

```
```{r, echo=FALSE, warning = FALSE, message = FALSE, fig.cap = 'Corn and Soybean Prices' }
plot1 <- autoplot(CZ2016, ylab = "Corn Prices, cents/bu") + theme_bw()
plot2 <- autoplot(SX2016, ylab = "Soybean Prices, cents/bu") + theme_bw()
grid.arrange(plot1, plot2, ncol=1)
```
Binary file modified tablesandfigures-example.pdf
Binary file not shown.

0 comments on commit 5becd3e

Please sign in to comment.