Getting started with R LanguageData framesReading and writing tabular data in plain-text files (CSV, TSV, etc.)Pipe operators (%>% and others)Linear Models (Regression)data.tableboxplotFormulaSplit functionCreating vectorsFactorsPattern Matching and ReplacementRun-length encodingDate and TimeSpeeding up tough-to-vectorize codeggplot2ListsIntroduction to Geographical MapsBase PlottingSet operationstidyverseRcppRandom Numbers GeneratorString manipulation with stringi packageParallel processingSubsettingDebuggingInstalling packagesArima ModelsDistribution FunctionsShinyspatial analysissqldfCode profilingControl flow structuresColumn wise operationJSONRODBClubridateTime Series and Forecastingstrsplit functionWeb scraping and parsingGeneralized linear modelsReshaping data between long and wide formsRMarkdown and knitr presentationScope of variablesPerforming a Permutation TestxgboostR code vectorization best practicesMissing valuesHierarchical Linear ModelingClassesIntrospection*apply family of functions (functionals)Text miningANOVARaster and Image AnalysisSurvival analysisFault-tolerant/resilient codeReproducible RUpdating R and the package libraryFourier Series and Transformations.RprofiledplyrcaretExtracting and Listing Files in Compressed ArchivesProbability Distributions with RR in LaTeX with knitrWeb Crawling in RArithmetic OperatorsCreating reports with RMarkdownGPU-accelerated computingheatmap and heatmap.2Network analysis with the igraph packageFunctional programmingGet user inputroxygen2HashmapsSpark API (SparkR)Meta: Documentation GuidelinesI/O for foreign tables (Excel, SAS, SPSS, Stata)I/O for database tablesI/O for geographic data (shapefiles, etc.)I/O for raster imagesI/O for R's binary formatReading and writing stringsInput and outputRecyclingExpression: parse + evalRegular Expressions (regex)CombinatoricsPivot and unpivot with data.tableInspecting packagesSolving ODEs in RFeature Selection in R -- Removing Extraneous FeaturesBibliography in RMDWriting functions in RColor schemes for graphicsHierarchical clustering with hclustRandom Forest AlgorithmBar ChartCleaning dataRESTful R ServicesMachine learningVariablesThe Date classThe logical classThe character classNumeric classes and storage modesMatricesDate-time classes (POSIXct and POSIXlt)Using texreg to export models in a paper-ready wayPublishingImplement State Machine Pattern using S4 ClassReshape using tidyrModifying strings by substitutionNon-standard evaluation and standard evaluationRandomizationObject-Oriented Programming in RRegular Expression Syntax in RCoercionStandardize analyses by writing standalone R scriptsAnalyze tweets with RNatural language processingUsing pipe assignment in your own package %<>%: How to ?R Markdown Notebooks (from RStudio)Updating R versionAggregating data framesData acquisitionR memento by examplesCreating packages with devtools

RMarkdown and knitr presentation

Other topics

Remarks:

Sub options parameters:

sub-optiondescriptionhtmlpdfwordodtrtfmdgithubioslidesslidybeamer
citation_packageThe LaTeX package to process citations, natbib, biblatex or noneXXX
code_foldingLet readers to toggle the display of R code, "none", "hide", or "show"X
colorthemeBeamer color theme to useX
cssCSS file to use to style documentXXX
devGraphics device to use for figure output (e.g. "png")XXXXXXX
durationAdd a countdown timer (in minutes) to footer of slidesX
fig_captionShould figures be rendered with captions?XXXXXXX
fig_height, fig_widthDefault figure height and width (in inches) for documentXXXXXXXXXX
highlightSyntax highlighting: "tango", "pygments", "kate","zenburn", "textmate"XXXXX
includesFile of content to place in document (in_header, before_body, after_body)XXXXXXXX
incrementalShould bullets appear one at a time (on presenter mouse clicks)?XXX
keep_mdSave a copy of .md file that contains knitr outputXXXXXX
keep_texSave a copy of .tex file that contains knitr outputXX
latex_engineEngine to render latex, or ""pdflatex", "xelatex", lualatex"XX
lib_dirDirectory of dependency files to use (Bootstrap, MathJax, etc.)XXX
mathjaxSet to local or a URL to use a local/URL version of MathJax to renderXXX
md_extensionsMarkdown extensions to add to default definition or R MarkdownXXXXXXXXXX
number_sectionsAdd section numbering to headersXX
pandoc_argsAdditional arguments to pass to PandocXXXXXXXXXX
preserve_yamlPreserve YAML front matter in final document?X
reference_docxdocx file whose styles should be copied when producing docx outputX
self_containedEmbed dependencies into the docXXX
slide_levelThe lowest heading level that defines individual slidesX
smallerUse the smaller font size in the presentation?X
smartConvert straight quotes to curly, dashes to em-dashes, ... to ellipses, etc.XXX
templatePandoc template to use when rendering fileXXXXX
themeBootswatch or Beamer theme to use for pageXX
tocAdd a table of contents at start of documentXXXXXXX
toc_depthThe lowest level of headings to add to table of contentsXXXXXX
toc_floatFloat the table of contents to the left of the main contentX

Rstudio example

This is a script saved as .Rmd, on the contrary of r scripts saved as .R.

To knit the script, either use the render function or use the shortcut button in Rstudio.

--- 
title: "Rstudio exemple of a rmd file"
author: 'stack user'
date: "22 July 2016"
output: html_document
---

The header is used to define the general parameters and the metadata.

## R Markdown

This is an R Markdown document.
It is a script written in markdown with the possibility to insert chunk of R code in it.
To insert R code, it needs to be encapsulated into inverted quote.

Like that for a long piece of code:

```{r cars}
summary(cars)
```

And like ``r cat("that")`` for small piece of code.

## Including Plots

You can also embed plots, for example:

```{r echo=FALSE}
plot(pressure)
```

Adding a footer to an ioslides presentation

Adding a footer is not natively possible. Luckily, we can make use of jQuery and CSS to add a footer to the slides of an ioslides presentation rendered with knitr. First of all we have to include the jQuery plugin. This is done by the line

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>

Now we can use jQuery to alter the DOM (document object model) of our presentation. In other words: we alter the HTML structure of the document. As soon as the presentation is loaded ($(document).ready(function() { ... })), we select all slides, that do not have the class attributes .title-slide, .backdrop, or .segue and add the tag <footer></footer> right before each slide is 'closed' (so before </slide>). The attribute label carries the content that will be displayed later on.

All we have to do now is to layout our footer with CSS:

After each <footer> (footer::after):

  • display the content of the attribute label
  • use font size 12
  • position the footer (20 pixels from the bottom of the slide and 60 pxs from the left)

(the other properties can be ignored but might have to be modified if the presentation uses a different style template).

---
title: "Adding a footer to presentaion slides"
author: "Martin Schmelzer"
date: "26 Juli 2016"
output: ioslides_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>

<script>
    $(document).ready(function() {
      $('slide:not(.title-slide, .backdrop, .segue)').append('<footer label=\"My amazing footer!\"></footer>');    
    })
</script>

<style>
  footer:after {
    content: attr(label);
    font-size: 12pt;
    position: absolute;
    bottom: 20px;
    left: 60px;
    line-height: 1.9;
  }
</style>


## Slide 1

This is slide 1.

## Slide 2

This is slide 2

# Test

## Slide 3

And slide 3.

The result will look like this:

enter image description here

Syntax:

  • Header:
    • YAML format, used when the script is compile to define general parameter and metadata

Parameters:

Parameterdefinition
titlethe title of the document
authorThe author of the document
dateThe date of the document: Can be "r format(Sys.time(), '%d %B, %Y')"
authorThe author of the document
outputThe output format of the document: at least 10 format available. For html document, html_output. For PDF document, pdf_document, ..

Contributors

Topic Id: 2999

Example Ids: 10183,13950

This site is not affiliated with any of the contributors.