<<

programming

prof. UAM dr hab. Tomasz Górecki [email protected]

Department of Mathematical Statistics and Data Analysis Faculty of Mathematics and Computer Science Adam Mickiewicz University in Poznań

...... Tomasz Górecki (UAM) R programming 1 / 13 R – idea

R Markdown provides an authoring framework for data science. You can use a single R Markdown file to both save and execute code, and generate high quality reports that can be shared with an audience. R Markdown was designed for easier reproducibility, since both the computing code and narratives are in the same document, and results are automatically generated from the source code. R Markdown supports dozens of static and dynamic/interactive output formats.

...... Tomasz Górecki (UAM) R programming 2 / 13 R Markdown – materials

Video https://vimeo.com/178485416 – short introduction to R Markdown. https://youtu.be/YXSp6VfZaUk – creating R Markdown file https://youtu.be/DNS7i2m4sB0 – R Markdown with RStudio. https://youtu.be/hODWGzpiCV0 – R Markdown tutorial. Books https://bookdown.org/yihui/rmarkdown/ – R Markdown: The Definitive Guide. https://github.com/rstudio/bookdown – Bookdown: Authoring Books and Technical Documents with R Markdown.

...... Tomasz Górecki (UAM) R programming 3 / 13 Markdown

Markdown is a simple formatting language designed to make authoring content easy for everyone. Rather than write in complex markup code (e.g. HTML or LaTeX), you write in with formatting cues. uses these cues to turn your document into attractive output.

...... Tomasz Górecki (UAM) R programming 4 / 13 R Markdown – create document

Creating documents with R Markdown starts with an .Rmd file that contains a combination of markdown (content with simple text formatting) and R code chunks. The .Rmd file is fed to , which executes all of the R code chunks and creates a new markdown (.md) document which includes the R code and it’s output. The markdown file generated by knitr is then processed by pandoc which is responsible for creating a finished web page, PDF, MS Word document or other format. This may sound complicated, but R Markdown makes it extremely simple by encapsulating all of the above processing into a single render function.

...... Tomasz Górecki (UAM) R programming 5 / 13 R Markdown – output formats

You can create many types of output from a single .Rmd file. R Markdown has built in support for HTML, PDF, MS Word, ODT, RTF, Markdown, and Github flavored Markdown documents; Beamer, slidy.js, ioslides, and reveal.js slideshows; and websites, dashboards, books, handouts, package vignettes, and Shiny apps.

...... Tomasz Górecki (UAM) R programming 6 / 13 R Markdown – structure of document

There are three basic components of an R Markdown document: metadata, text, code. The metadata is written between the pair of three dashes —. The syntax for the metadata is YAML, so sometimes it is also called the YAML metadata or the YAML frontmatter. The body of a document follows the metadata. The syntax for text is Markdown. There are two types of computer code: A code chunk starts with three backticks like ```r where r indicates the language name, and ends with three backticks. An inline R code expression starts with `r and ends with a backtick `.

...... Tomasz Górecki (UAM) R programming 7 / 13 R code chunks

Within an R Markdown file, R code chunks can be embedded with the native Markdown syntax for fenced code regions.

...... Tomasz Górecki (UAM) R programming 8 / 13 Inline R code

You can also evaluate R expressions inline by enclosing the expression within a single back-tick qualified with ’r’.

...... Tomasz Górecki (UAM) R programming 9 / 13 Formatting text

header 1: # header 1 header 2: ## header 2 header 3: ### header 3 header 4: #### header 4 bold: **text** italics: *text* link: [link](text) Image: Logo ![Logo](img/logo.png) LaTeX: $A = \pi \times r^{2}$

...... Tomasz Górecki (UAM) R programming 10 / 13 Selected instructions for code chunks

eval – Is the code run and the results included in the output? include – Are the code and the results included in the output (the code is still run)? echo – Is the code displayed alongside the results. warning – Are warning messages displayed. error – Are error messages displayed. message – Are messages displayed. cache – Are the results cached for future renders. dev – format of generated images (default PNG). fig.width – Width (in inches) of the plots. fig.height – Height (in inches) of the plots. fig.align – Align of the plots: “left”, “right”, “center”.

...... Tomasz Górecki (UAM) R programming 11 / 13 R Markdown – cheatsheet

Pandoc’s Markdown Set render options with YAML Write with syntax on the le! to create e"ect on right (a!er render) When you render, R Markdown rmarkdown Plain text 1. runs the R code, embeds results and text into .md file with knitr End a line with two spaces to start a new paragraph. 2. then converts the .md file into the finished format with pandoc *italics* and **bold** `verbatim code` sub/superscript^2^~2~ sub-option description ~~~~ pdf word odt rtf md gituhb ioslides slidy beamer escaped: \* \_ \\ citation_package The LaTeX package to process citations, natbib, biblatex or none X X X endash: --, emdash: --- equation: $A = \pi*r^{2}$ Set a document’s code_folding Let readers to toggle the display of R code, "none", "hide", or "show" X default output format --- equation block: output: html_document colortheme Beamer color theme to use X in the YAML header: --- $$E = mc^{2}$$ # Body css CSS file to use to style document X X X > block quote dev Graphics device to use for figure output (e.g. "png") X X X X X X X duration Add a countdown timer (in minutes) to footer of slides X # Header1 {#anchor} output value creates fig_caption Should figures be rendered with captions? X X X X X X X ## Header 2 {#css_id} html_document html fig_height, fig_width Default figure height and width (in inches) for document X X X X X X X X X X ### Header 3 {.css_class} pdf_document pdf (requires Tex ) word_document Microso! Word (.docx) highlight : "tango", "pygments", "kate","zenburn", "" X X X X X #### Header 4 odt_document OpenDocument Text includes File of content to place in document (in_header, before_body, a!er_body) X X X X X X X X ##### Header 5 rtf_document incremental Should bullets appear one at a time (on presenter mouse clicks)? X X X ###### Header 6 md_document Markdown keep_md Save a copy of .md file that contains knitr output X X X X X X

github_document Github compatible markdown keep_tex Save a copy of . file that contains knitr output X X ioslides_presentation ioslides HTML slides latex_engine Engine to render , "pdflatex", "xelatex", or "lualatex" X X \textbf{Tex ignored in HTML} HTML ignored in pdfs slidy_presentation slidy HTML slides lib_dir Directory of dependency files to use (Bootstrap, MathJax, etc.) X X X beamer_presentation Beamer pdf slides (requires Tex) mathjax Set to local or a URL to use a local/URL version of MathJax to render equations X X X [link](www.rstudio.com) Jump to [Header 1](#anchor) Indent 2 Indent 4 md_extensions Markdown extensions to add to default definition or R Markdown X X X X X X X X X X spaces spaces image: Customize output with --- number_sections Add section numbering to headers X X sub-options (listed to output: html_document: ![Caption](smallorb.png) the right): code_folding: hide pandoc_args Additional arguments to pass to Pandoc X X X X X X X X X X * unordered list toc_float: TRUE preserve_yaml Preserve YAML front matter in final document? X + sub-item 1 --- + sub-item 2 # Body reference_docx docx file whose styles should be copied when producing docx output X - sub-sub-item 1 self_contained Embed dependencies into the doc X X X

* item 2 html tabsets slide_level The lowest heading level that defines individual slides X Continued (indent 4 spaces) Use tablet css class to place sub-headers into tabs smaller Use the smaller font size in the presentation? X

1. ordered list # Tabset {.tabset .tabset-fade .tabset-pills} smart Convert straight quotes to curly, dashes to em-dashes, … to ellipses, etc. X X X 2. item 2 ## Tab 1 template Pandoc template to use when rendering file quarterly_report.html). X X X X X i) sub-item 1 A. sub-sub-item 1 text 1 Tabset theme Bootswatch or Beamer theme to use for page X X

(@) A list whose numbering ## Tab 2 Tab 1 Tab 2 toc Add a table of contents at start of document X X X X X X X text 2 continues a!er text 1 toc_depth The lowest level of headings to add to table of contents X X X X X X ### End tabset End tabset toc_float Float the table of contents to the le! of the main content X (@) an interruption

Term 1 : Definition 1 Create a Reusable Template Table Suggestions Citations and Bibliographies | Right | Le! | Default | Center | 1. Create a new package with a inst/rmarkdown/templates Several functions format R data into tables Create citations with .bib, .bibtex, .copac, .enl, ., |------:|:-----|------|:------:| directory .medline, .mods, .ris, .wos, and . files | 12 | 12 | 12 | 12 | | 123 | 123 | 123 | 123 | 2. In the directory, Place a folder that contains: --- | 1 | 1 | 1 | 1 | template. (see below) 1. Set bibliography file and CSL 1.0 bibliography: refs.bib

skeleton.Rmd (contents of the template) Style file (optional) in the YAML header csl: style.csl - slide bullet 1 any supporting files - slide bullet 2 2. Use citation keys in text --- 3. Install the package (>- to have bullets appear on click) 4. Access template in wizard at File ▶ New File ▶ R Markdown data <- faithful[1:4, ] Smith cited [@smith04]. horizontal rule/slide break: template.yaml ```{r results = 'asis'} Smith cited without author [-@smith04]. knitr::kable(data, caption = "Table with kable”) @smith04 cited in line. *** --- ``` A footnote [^1] name: My Template ```{r results = "asis"} — print(xtable::xtable(data, caption = "Table with xtable”), 3. Render. Bibliography will be [^1]: Here is the footnote. type = "html", html.table.attributes = "border=0")) added to end of document ``` Learn more in ```{r results = "asis"} the stargazer, stargazer::stargazer(data, type = "html", title = "Table xtable, and knitr with stargazer") packages. ``` RStudio® is a trademark of RStudio, Inc. • CC BY SA RStudio • [email protected] • 844-448-1212 • rstudio.com. • Learn. more .at rmarkdown.rstudio.com. . . . . • rmarkdown. . . 1.6 • Updated:. . 2016-02...... Tomasz Górecki (UAM) R programming 12 / 13 R Markdown – cheatsheet

File path to output document R Markdown : : CHEAT SHEET 5 1 Find in document synch publish rmarkdown What is R Markdown? button to .rmd Structure accounts at YAML Header .Rmd files · An R Markdown 4 rpubs.com, Optional section of render (e.g. pandoc) 3 options written as key:value pairs (YAML). (.Rmd) file is a record of your shinyapps.io research. It contains the code that a At start of file scientist needs to reproduce your work set insert run code RStudio Connect Between lines of - - - Rmd along with the narration that a reader preview code chunk(s) go to needs to understand your work. location chunk Text 2 code Reload document Narration formatted with markdown, mixed with: Reproducible Research · At the click of a chunk publish button, or the type of a command, you Code Chunks show Chunks of embedded code. Each chunk: can rerun the code in an R Markdown file outline to reproduce your work and export the Begins with ```{r} results as a finished report. ends with ``` Dynamic Documents · You can choose R Markdown will run the code and append the results to the doc. to export the finished report in a variety It will use the location of the .Rmd file as the working directory of formats, including html, pdf, MS run all Word, or RTF documents; html or pdf previous based slides, Notebooks, and more. chunks modify run chunk current Parameters --- options chunk params: Parameterize your documents to reuse n: 100 Workflow with new inputs (e.g., data, values, etc.) d: !r Sys.Date() --- 1. Add parameters · Create and set parameters in the header as sub- values of params Today’s date is `r params$d` 2. Call parameters · Call parameter values in code as params$ 6 3. Set parameters · Set values wth 1 Open a new .Rmd file at File ▶ New File ▶ Knit with parameters or the params R Markdown. Use the wizard that opens to pre- argument of render(): populate the file with a template 7 render("doc.Rmd", params = list(n = 1, 2 Write document by editing template d = as.Date("2015-01-01")) 3 Knit document to create report; use knit button or render() to knit 4 Preview Output in IDE window render Interactive Documents Use rmarkdown::render() to render/knit at cmd line. Important args: 5 Publish (optional) to web server Turn your report into an interactive Shiny document in 4 steps input - file to render output_options - output_file params - list of envir - environment encoding - of input 6 Examine build log in R Markdown console 1. Add runtime: shiny to the YAML header. output_format List of render output_dir params to use to evaluate code file 7 Use output file that is saved along side .Rmd options (as in YAML) chunks in 2. Call Shiny input functions to embed input objects. 3. Call Shiny render functions to embed reactive output. Embed code with knitr syntax 4. Render w rmarkdown::run or click Run Document in RStudio IDE INLINE CODE CODE CHUNKS GLOBAL OPTIONS --- Insert with `r `. Results appear as text without code. One or more lines surrounded with ```{r} and ```. Place chunk Set with knitr::opts_chunk$set(), e.g. output: html_document options within curly braces, a!er r. Insert with runtime: shiny Built with `r getRversion()` Built with 3.2.3 ```{r include=FALSE} --- ```{r echo=TRUE} knitr::opts_chunk$set(echo = TRUE) getRversion() ``` ```{r, echo = FALSE} ``` numericInput("n", "How many cars?", 5) IMPORTANT CHUNK OPTIONS renderTable({ cache - cache results for future knits (default = dependson - chunk dependencies for caching fig.align - 'le!', 'right', or 'center' (default = message - display code messages in head(cars, input$n) FALSE) (default = NULL) 'default') document (default = TRUE) }) cache.path - directory to save cached results in echo - Display code in output document (default = fig.cap - figure caption as character string (default results (default = 'markup') ``` (default = "cache/") TRUE) = NULL) 'asis' - passthrough results

child - file(s) to knit and then include (default = engine - code language used in chunk (default = fig.height, fig.width - Dimensions of plots in 'hide' - do not display results NULL) 'R') inches 'hold' - put all results below all code Embed a complete app into your document with collapse - collapse all output into single block error - Display error messages in doc (TRUE) or highlight - highlight source code (default = TRUE) tidy - tidy code for display (default = FALSE) shiny::shinyAppDir() (default = FALSE) stop render when errors occur (FALSE) (default = include - Include chunk in doc a!er running warning - display code warnings in document comment - prefix for each line of results (default = '##') FALSE) (default = TRUE) (default = TRUE) Publish on RStudio Connect, to share R eval - Run code in chunk (default = TRUE) Markdown documents securely, schedule automatic Options not listed above: R.options, aniopts, autodep, background, cache.comments, cache.lazy, cache.rebuild, cache.vars, dev, dev.args, dpi, engine.opts, engine.path, fig.asp, fig.env, fig.ext, fig.keep, fig.lp, fig.path, fig.pos, fig.process, fig.retina, fig.scap, fig.show, fig.showtext, fig.subcap, interval, updates, and interact with parameters in real time. out.extra, out.height, out.width, prompt, purl, ref.label, render, size, split, tidy.opts www.rstudio.com/products/connect/

RStudio® is a trademark of RStudio, Inc. • CC BY SA RStudio • [email protected] • 844-448-1212 • rstudio.com. • Learn. more .at rmarkdown.rstudio.com. . . . . • rmarkdown. . . 1.6 • Updated:. . 2016-02...... Tomasz Górecki (UAM) R programming 12 / 13 LaTeX – cheatsheet

LATEX2" Cheat Sheet Lists Justification \begin{enumerate} Numbered list. Environment Declaration \begin{itemize} Bulleted list. \begin{center} \centering Document classes \begin{description}Description list. book Default is two-sided. \begin{flushleft} \raggedright \item text Add an item. report No \part divisions. \begin{flushright} \raggedleft \item[x] text Use x instead of normal bullet or number. Re- article No \part or \chapter divisions. quired for descriptions. Miscellaneous letter Letter (?). slides Large sans-serif font. References \linespread{x} changes the line spacing by the multiplier x. Used at the very beginning of a document: \documentclass{class}. \label{marker} Set a marker for cross-reference, often of the form Use \begin{document} to start contents and \end{document} to end \label{sec:item}. Text-mode symbols the document. \ref{marker} Give section/body number of marker. Symbols \pageref{marker} Give page number of marker. Common documentclass options & \& \_ ... \ldots \textbullet \footnote{text} Print footnote at bottom of page. • 10pt/11pt/12pt Font size. $ \$ ˆ \^{} \textbar \textbackslash | \ letterpaper/a4paper Paper size. Floating bodies % \% ˜ \~{} # \# \S § twocolumn Use two columns. \begin{table}[place] Add numbered table. twoside Set margins for two-sided. \begin{figure}[place] Add numbered figure. Accents landscape Landscape orientation. Must use dvips -t \begin{equation}[place] Add numbered equation. `o \‘o ´o \’o ˆo \^o ˜o \~o ¯o \=o landscape. \caption{text} Caption for the body. ˙o \.o ¨o \"o ¸o \ o ˇo \v o ˝o \H o ¸c \c c o \d o o \b o oo \t oo œ \oe draft Double- lines. The place is a list valid placements for the body. t=top, h=here, . ¯ Usage: \documentclass[opt,opt]{class}. b=bottom, p=separate page, !=place even if ugly. Captions and Œ \OE æ \ae Æ \AE ˚a \aa A˚ \AA label markers should be within the environment. ø \o Ø \O l \l L \L ı \i Packages ⌘ \j ¡ ~‘ ¿ ?‘ fullpage Use 1 inch margins. Text properties anysize Set margins: \marginsize{l}{r}{t}{b}. Font face multicol Use n columns: \begin{multicols}{n}. ‘ ‘ “ ‘‘ \{ [ [ ( ( < \textless Command Declaration E↵ect { latexsym Use LAT Xsymbolfont. ’ ’ ” ’’ \} ] ] ) ) > \textgreater E \textrm{text}{\rmfamilytext} Roman family } graphicx Show image: \includegraphics[width=x]{file}. \textsf{text}{\sffamilytext} Sans serif family url Insert URL: \url{http://. . . }. Dashes \texttt{text}{\ttfamilytext}Typewriterfamily Use before \begin{document}.Usage:\usepackage{package } Name Source Example Usage \textmd{text}{\mdseriestext} Medium series - X-ray In words. Title \textbf{text}{\bfseriestext} Bold series en-dash -- 1–5 Between numbers. \author{text} Author of document. \textup{text}{\upshapetext} Upright shape em-dash --- Yes—or no? Punctuation. \title{text} Title of document. \textit{text}{\itshapetext} Italic shape \date{text} Date. \textsl{text}{\slshapetext} Slanted shape Line and page breaks These commands go before \begin{document}.Thedeclaration \textsc{text}{\scshapetext} Small Caps shape \\ Begin new line without new paragraph. \maketitle goes at the top of the document. \emph{text}{\emtext} Emphasized \\* Prohibit pagebreak after linebreak. \textnormal{text}{\normalfont text}Document font Miscellaneous \kill Don’t print current line. \underline{text} Underline \pagebreak Start new page. \pagestyle{empty} Empty header, footer and no page numbers. The command (tttt) form handles spacing better than the \noindent Do not indent current line. \tableofcontents Add a table of contents here. declaration (tttt) form. Document structure Miscellaneous Font size \today March 28, 2017. \part{title} \subsubsection{title} \tiny tiny \Large Large $\sim$ Prints instead of \~{},whichmakes˜. \chapter{title} \paragraph{title} \scriptsize scriptsize ~ Space,⇠ disallow linebreak (W.J.~Clinton). \section{title} \subparagraph{title} \LARGE LARGE \footnotesize footnotesize \@. Indicate that the . ends a sentence when following an \subsection{title} \small small \huge uppercase letter. Use \setcounter{secnumdepth}{x} suppresses heading numbers of huge \normalsize normalsize \hspace{l} Horizontal space of length l (Ex: l = 20pt). depth >x,wherechapter has depth 0. Use a *,asin \large large \vspace{l} Vertical space of length l. \section*{title},tonotnumberaparticularitem—theseitemswill \Huge Huge \rule{w}{h} Line of width w and height h. also not appear in the table of contents. These are declarations and should be used in the form {\small ...}, or without braces to a↵ect the entire document. Text environments Tabular environments \begin{comment} Comment (not printed). Requires verbatim pack- Verbatim text tabbing environment age. \begin{verbatim} Verbatim environment. \begin{quote} Indented quotation block. \begin{verbatim*} Spaces are shown as . \= Set tab stop. \> Go to tab stop. \begin{quotation}Like quote with indented paragraphs. \verb!text! Text between the delimiting characters (in this Tab stops can be set on “invisible” lines with \kill at the end of the line. Normally \\ is used to separate lines. \begin{verse} Quotation block for verse. case ‘!’) is verbatim...... Tomasz Górecki (UAM) R programming 13 / 13 LaTeX – cheatsheet

tabular environment Citation types The LATEXdocumentshouldhavethefollowingtwolinesjustbefore \end{document},wherebibfile.bib is the name of the BibT Xfile. \begin{array}[pos ]{cols } \cite{key} Full author list and year. (Watson and Crick 1953) E \citeA{key} Full author list. (Watson and Crick) \begin{tabular}[pos ]{cols } \bibliographystyle{plain} \citeN{key} Full author list and year. Watson and Crick (1953) \begin{tabular*}{width}[pos ]{cols } \bibliography{bibfile} \shortcite{key} Abbreviated author list and year. ? tabular column specification \shortciteA{key} Abbreviated author list. ? \shortciteN{key} Abbreviated author list and year. ? BibTEX example l Left-justified column. \citeyear{key} Cite year only. (1953) The BibTEXdatabasegoesinafilecalledfile.bib,whichis c Centered column. All the above have an NP variant without parentheses; Ex. \citeNP. processed with bibtex file. r Right-justified column. @String{N = {Na\-ture}} p{width} Same as \parbox[t]{width}. BibTEX entry types @{decl} Insert decl instead of inter-column space. @Article{WC:1953, @article Journal or magazine article. | Inserts a vertical line between columns. author = {James Watson and Francis Crick}, @book Book with publisher. title = {A structure for Deoxyribose Nucleic Acid}, tabular elements @booklet Book without publisher. journal = N, @conference Article in conference proceedings. volume = {171}, \hline Horizontal line between rows. @inbook Apartofabookand/orrangeofpages. pages = {737}, \cline{x-y} Horizontal line across columns x through y. @incollection Apartofbookwithitsowntitle. year = 1953 \multicolumn{n}{cols }{text} @misc If nothing else fits. } Acellthatspansn columns, with cols column specifi- @phdthesis PhD. thesis. cation. @proceedings Proceedings of a conference. A @techreport Tech report, usually numbered in series. Sample LTEX document Math mode @unpublished Unpublished. \documentclass[11pt]{article} \usepackage{fullpage} For inline math, use \(...\) or $...$.Fordisplayedmath,use BibTEX fields \title{Template} \[...\] or \begin{equation}. \author{Name} address Address of publisher. Not necessary for major publish- x ^{x} _{x} \begin{document} Superscript Subscriptx ers. x \frac{x}{y} n \sum_{k=1}^n \maketitle y k=1 author n Names of authors, of format .... pn x \sqrt[n]{x} \prod_{k=1}^n booktitle Title of book when part of it is cited. k=1 \section{section} P chapter Chapter or section number. \subsection*{subsection without number} Math-mode symbols Q edition Edition of a book. text \textbf{bold text} text. Some math: $2+2=5$ editor Names of editors. \leq \geq = \neq \approx \subsection{subsection}  6 ⇡ institution Sponsoring institution of tech. report. \times \div \pm \cdot text \emph{emphasized text} text. \cite{WC:1953} ⇥ ÷ ± · journal Journal name. ^{\circ} \circ \prime \cdots discovered the structure of DNA. key \infty \neg 0 \wedge ··· \vee Used for cross ref. when no author. 1 ¬ ^ _ month Month published. Use 3-letter abbreviation. \supset \forall \in \rightarrow Atable: 8 2 ! note Any additional information. \subset \exists / \notin \Rightarrow \begin{table}[!th] ⇢ 9 2 ) number Number of journal or magazine. \cup \cap \mid \Leftrightarrow \begin{tabular}{|l|c|r|} [ \ | , organization Organization that sponsors a conference. a˙ \dot a aˆ \hat a a¯ \bar a a˜ \tilde a \hline pages Page range (2,6,9--12). ↵ \alpha \beta \gamma \delta first & row & data \\ publisher Publisher’s name. ✏ \epsilon ⇣ \zeta ⌘ \eta " \varepsilon second & row & data \\ school Name of school (for thesis). ✓ \theta ◆ \iota  \kappa # \vartheta \hline series Name of series of books. \lambda µ \mu ⌫ \nu ⇠ \xi \end{tabular} title Title of work. ⇡ \pi ⇢ \rho \sigma ⌧ \tau \caption{This is the caption} type Type of tech. report, ex. “Research Note”. \upsilon \phi \chi \psi \label{ex:table} volume Volume of a journal or book. ! \omega \Gamma \Delta ⇥ \Theta \end{table} year Year of publication. ⇤ \Lambda ⌅ \Xi ⇧ \Pi ⌃ \Sigma Not all fields need to be filled. See example below. ⌥ \Upsilon \Phi \Psi ⌦ \Omega The table is numbered \ref{ex:table}. Common BibT X style files \end{document} Bibliography and citations E abbrv Standard abstract alpha with abstract When using BibTEX, you need to run latex, bibtex,andlatex alpha Standard apa APA Copyright c 2014 Winston Chang twice more to resolve dependencies. plain Standard unsrt Unsorted http://wch.github.io/latexsheet/

...... Tomasz Górecki (UAM) R programming 13 / 13