Hello world -- blogdown
Gist
Blogdown accepts .md or .rmd files, write as though it’s any other .rmd file. links are made with [txt](link)
and images are made with ![hover_txt](img)
. Keep in mind the cheatsheet and your favorite .rmd settings.
Remember to store static
files like images and data in ./static/
(ie. ./static/MyFolder/Pic1.png
) and reference them from relative to the stat folder![My picture](/MyFolder/Pic1.png)
.
However, data is stored and referneced as any other .rmd. (ie ./content/posts/data/df.rda
) is called with load("./data/df.rda")
.
R code
Blogdown runs R chunks as any R markdown would:
"hello world, now in an `R` chunk!"
## [1] "hello world, now in an `R` chunk!"
head(mtcars)
## 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
Referencing images and data
Navigating images is handled differently than .rmd’s, while loading data is handled the same. Dr. Navarro has a long post about this here. In short, here are a few working examples. If you need help getting started, you can check the the \static\helloworld
and \content\posts\helloworld
on my github repo.
local data
load("./helloworld/df.rda")
head(df)
## x y
## 1 0.218540 0.32562
## 2 -0.299294 -0.68676
## 3 1.874378 -1.23817
## 4 0.369050 0.31933
## 5 0.925992 -0.06391
## 6 -0.004362 -1.70455
Local image
![](/helloworld/doggo.gif)
Online image
![](https://media.giphy.com/media/bbshzgyFQDqPHXBo4c/giphy.gif)