Created
September 12, 2014 16:52
-
-
Save jhollist/2d817b30ccd570e8e184 to your computer and use it in GitHub Desktop.
Example of .Rmd, with YAML trying to interpret code and objects set later in document
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: 'How do I interpret R code in YAML?' | |
author: Jeff Hollister | |
output: | |
pdf_document: | |
fig_caption: yes | |
keep_tex: yes | |
number_sections: yes | |
html_document: null | |
word_document: null | |
fontsize: 11pt | |
capsize: normalsize | |
csl: components/ecology.csl | |
documentclass: article | |
abstract: This is a test. Is this `r mean(x)` working? | |
--- | |
This is a test of outputing a pdf, with R code interpretted in the YAML front mater. Use case for this would be a manuscript, with abstract as part of YAML, and some of the results in the abstract being calculated in the body of the Rmd. For instance: | |
```{r} | |
x<-rnorm(100) | |
mn<-mean(x) | |
mn | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment