Sharedlatex-tests / 2018-01-28-210904.rnwOpen in CoCalc
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{url}
\begin{document}

% learn more about knitr: https://yihui.name/knitr/

<<setup, include=FALSE, cache=FALSE>>=
library(knitr)
opts_chunk$set(cache=TRUE, autodep=TRUE)
options(formatR.arrow=TRUE, width=90)
@

\title{Knitr in SMC}

\author{Author Name}

\maketitle

<<summary>>=
x <- c(2,3,4,5,1,2,3,2,1)
summary(x)
@

<<histogram-plot, fig.width=4, fig.height=4, out.width='.4\\linewidth'>>=
hist(x)
@

Sum of \Sexpr{paste(x, collapse="+")} is \Sexpr{sum(x)}.


\end{document}