Created
July 26, 2012 14:57
-
-
Save ramnathv/3182540 to your computer and use it in GitHub Desktop.
Power of Templates in Slidify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<slide class="{{ classes }}" id="{{ id }}"> | |
<hgroup> | |
{{{ header}}} | |
</hgroup> | |
<article> | |
{{{ content }}} | |
</article> | |
</slide> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- &twocol w1:40% w2:60% | |
## Probability Distribution ## | |
The probability distribution of a random variable X tells us what possible | |
values X can take and how to assign probabilities to those values. | |
*** left | |
```{r tab1, message = F} | |
require(prob) | |
require(xtable) | |
Y = addrv(tosscoin(3, makespace = TRUE), FUN = function(x){ | |
sum(x == 'H') | |
}) | |
xtable(Y) | |
``` | |
*** right | |
```{r fig.width = 4, out.width = '350px', message = F} | |
require(ggplot2) | |
qplot(factor(X), probs, data = Y, geom = 'bar', stat = 'summary', fun.y = 'sum') + xlab('X') + ylab('Probability') | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: slide | |
--- | |
{{{ content }}} | |
<div style='float:left;width:{{{w1}}};' class='centered'> | |
{{{ left }}} | |
</div> | |
<div style='float:right;width:{{{w2}}};'> | |
{{{ right }}} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment