Posts

Some exemplary posts here.


Test Blogdown

Let’s do a little R with the cars dataset.

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
with(cars, plot(speed, dist))
a cars plot

The source is index.Rmd.


use custom render

In knitr/R/hooks-md.R there is a custom function render_jekyll.
I wrote a similar one for hugo that makes figure shortcodes.
Then I could remove the perl from the makefile.
This was a dirty hack which I am happy to got rid of. Suppose I will add some more shortcodes in the future.

For now see some examples here:

I use some examples from Producing Simple Graphs with R.

# Define the cars vector with 5 values
cars <- c(1, 3, 6, 4, 9)

# Graph the cars vector with all defaults
plot(cars)

float-right fig.cssClass
Figure one is supposed come right of this.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

read more..


slides

This is render from 009-slides % Writing beautiful and reproducible slides quickly % Yihui Xie % 2012/04/30 Why after you finished typing \documentclass{beamer} and \title{}, I have finished my first slide with markdown far fewer commands to remember, e.g. to write bullet points, just begin with a dash “-” instead of \begin{itemize} and \item; how things can be simpler? I know you want math to show you are a statistician, e.

read more..




use devtools

Although a blog post is not a R package the devtools package provides some useful tools. But who knows maybe a package will sprout from a post.

plain devtools

Provides some functions to create bundled data.
I like to use devtools::load_all() to load up all R functions from the R subdirectory.

I placed a simple function under R/hello_world.R

read more..


minimal R Markdown example

This is a render from knitr examples. A minimal R Markdown example A quote: Markdown is not LaTeX. To compile me, run this in R: library(knitr) knit(‘001-minimal.Rmd’) See output here. code chunks A paragraph here. A code chunk below (remember the three backticks): 1+1 ## [1] 2 .4-.7+.3 # what? it is not zero! ## [1] 5.551115e-17 graphics It is easy. plot(1:10) plot of chunk unnamed-chunk-2 hist(rnorm(1000)) plot of chunk unnamed-chunk-2 inline code Yes I know the value of pi is 3.

read more..