library(knitcitations) library(RefManageR) library(xtable) source('scripts/R/setup.R') cite_options(citation_format = 'pandoc', cite.style = "numeric") bib <- read.bibtex('bibtex/my_bib.bib') berger = citet('10.2307/2291285') knitc <- citet(citation('knitcitations'))
\MakeUppercase{fIrSt ThInGs FiRsT} - \underline{this IS your thesis}. As you start writing your document, you will replace this example content with your own. This document is meant to serve as a shell for your thesis and a primer on how to use Markdown. Throughout this document, you will find several references and/or resources showing how to include
Markdown is intended to be as easy-to-read and easy-to-write as is feasible. This means that
There are many advantages to building your thesis in Rmarkdown, this paper advantage of r try(berger)
For a quick cheatsheet on how to build an Rmarkdown, you can visit https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf.
It's really easy to go from a matrix
or a data.frame
to a \LaTeX-style table in under 5 seconds. For information on how to build a table in R, you can visit http://www.cyclismo.org/tutorial/R/tables.html. The following resource will get you started on how to get your table in R ready for publication https://www.r-bloggers.com/making-publication-ready-tables-with-xtable.
Plots are a useful way to display data. Building plots in R is quick and easy. The following is an example using the data set mtcars.
plot(mtcars$mpg,mtcars$hp, main="Scatterplot", xlab="Miles per Gallon", ylab="Horse Power", col="blue")
For a detailed and in depth desriptions on how to make plots, and the different kinds that R is capable of creating, you can visit http://www.statmethods.net/graphs/scatterplot.html.
The ggplot2 package has the ability to offer many more plotting options than the plot() command. You can learn more about ggplot2 by going to http://docs.ggplot2.org/current/ggplot.html. Creating a plot with ggplot2 will allow you to add layers of data to a single plot, which can be helpful in certain situations.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
In-line equations are included within a line of text like this $y=mx^2+b$
Display Equations stand out from the rest of the text:
N <- 30 Y <- rnorm(n = N, sd = 1, mean = 0) X <- rnorm(n = N, sd = 1, mean = 0) plot(x = sort(X), y = sort(Y), pch = 16, col = 'red', cex = 1.5, las = 1)
text, text, text
model <- lm(Y~X) xmodel <- xtable(summary(model), caption = 'Summary of Model') print(xmodel, comment = F, include.rownames = F, caption.placement = 'top')
$$\bar{Y}=\frac{\sum_{i=1}^N Y_i}{N}=\frac{r sum(Y)
}{r N
}$$
R gives you the ability to show the code that that was used for any plot, table, or function. You start a code chunk with r** and end a code chunk with **
. Let's use the code chunk for building plots above as an example of what you would see in a code chunk.
plot(mtcars$mpg,mtcars$hp, main="Scatterplot", xlab="Miles per Gallon", ylab="Horse Power", col="blue")
Code chunks have many options. You might choose to display a code chunk, like above. To do that you would add eval=FALSE. It would look like this ```r. For the purpose of displaying a plot you would add echo=FALSE in which case the code chunk would not be displayed at all. For a function, adding echo=FALSE would print only the answer to the function. For the function 2 + 2, it would look like this:
2+2
For a complete list of code chunk option, you can visit http://rmarkdown.rstudio.com/authoring_rcodechunks.html.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
This template demonstrates some of the basic latex you'll need to know to create a JSS article.
Don't use markdown, instead use the more precise latex commands:
This is a quote in markdown
Paragraph.
\begin{quote} This is a quote in \LaTeX \end{quote}
Can be inserted in regular R markdown blocks.
plot(rnorm(100), col = 2, pch = 16, las = 1)
Published articles have a Digital Object Identifier, or doi associated with them. The knitcitations
[r try(knitc)
] package allows us to easily cite papers by simply providing the doi. Note: This requires an internet connection
ISBN
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
The purpose of this is to show stuff to you. And I want to show you some really cool stuff.
write.bibtex(file = 'bibtex/final_bib.bib')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.