This is the title of the presentation

Mahbubul Majumder
Nov 13, 2014

First Slide with external picture

  • Notice in the source codes how this picture is added here.

new-talk

  • This picture shows how to create this presentation from RStudio
    • new file will start with a minimal reproducible presentations

Slide with Bullet Points

For more details on authoring R presentations click the Help button on the toolbar.

  • Bullet 1 required a space after - sign
    • sub bullet
      • sub-sub bullet required three more spaces
  • Bullet 2. Try to keep bullets simple
  • Bullet 3. Try not to write bullet more than a line
    • bullet does not have to be a complete sentence

Slide With R Code

summary(cars)
     speed           dist       
 Min.   : 4.0   Min.   :  2.00  
 1st Qu.:12.0   1st Qu.: 26.00  
 Median :15.0   Median : 36.00  
 Mean   :15.4   Mean   : 42.98  
 3rd Qu.:19.0   3rd Qu.: 56.00  
 Max.   :25.0   Max.   :120.00  

Slide With python or Linux command

  • This is a python command. Notice how we changed the engine to python
print "Hellow R"
Hellow R
  • This is a Linux command. Notice how we changed the engine to bash
pwd
/Users/mmajumder/Box Sync/myweb/data-science/fall-2014/lectures/21-datascience-lab
  • You can use other commands like C, awk etc.

Slide With Plot

  • Notice how the size of the plot is set plot of chunk unnamed-chunk-4

Slide With two columns

  • First column has a plot but no R code plot of chunk unnamed-chunk-5

  • Notice the first column is wider since left is set to be 70%

  • My Second column shows R code with results
head(women)
  height weight
1     58    115
2     59    117
3     60    120
4     61    123
5     62    126
6     63    129
  • second column is narrow
    • but why?

Slide with a table created from dataframe

  • This will show the head of dataframe mtcars in a table
library(knitr)
kable(head(mtcars), format="html")
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1

Slide with a user defined table

  • Notice in the codes, how this table is generated
package functions
base sample, union, intersect, rbind, unique, merge
plyr mutate, transmute
reshape2 melt, dcast
plyrmr bind.cols, transmute, select, where, count.cols, quantile.cols, top.k, bottom.k

Slide with math equation

The normal distribution can be written as

\[ f(x)=\frac1{\sqrt{2\pi \sigma^2}} e^{-\frac1{2\sigma^2} (x-\mu)^2} \]

Symbolically we write \[ X \sim N(\mu, \sigma^2) \]

Slide with HTML

This is the first heading

This is the second heading

This is a paragraph. It contains some plain text. The color, font-size and font-family of the texts are changed using CSS style. To check the HTML codes and tags used for this you may need to review the source codes of this presentation.

Slide with D3

  • Notice in the source code, how the HTML tags are written to produce this d3 animation.
    • the source could be found as .Rpres file
    • you can find it on github

Save presentation as HTML

  • At top right corner of RStudio, click on More, you will find the following options to save the presentation as HTML document.

save-Rpres

Slide with some reference