Building a Blogdown
Pre-Talk
Set the RStudio to install blogdown.
install.packages("blogdown")
and to get a working local version of Hugo, the static site generator at the heart of this,
blogdown::install_hugo()
Motivation
Credit where credit is due; Alison Hill motivated all of this with her wealth of resources. Indeed, I redesigned the flow for today because of her brilliant R-Ladies Canberra seminar [I found the resource links on Twitter and the idea is
All Credit to Alison Hill and Yihui Xie
Alison Hill’s magnificent resources on this.
I wish I had them when I had to figure this all out for myself.
Why Blogdown
Create a github site
If you do not already have one, you will need to create a github site. I created one for today called wucds1920 – Willamette University Certificate in Data Science 19/20. I would associate it with a professional durable email account.
Fork blankslate
Migrate to your fork
The Action
We will need to edit config.toml
in the root directory to reflect our chosen URL on netlify. The remaining action is:
The Magic of GitHub
My objectives are more limited. We want to Start a New Project…
From our github
We may need:
Let’s Edit….
just typing R code - Hadley Wickham
Change the name
And some associated content. Only a bit at a time.
For Fun: A First Post?
Addins : New Post
Something pretty simple.
data("UCBAdmissions")
# install.packages("ggalluvial")
library(tidyverse); library(ggalluvial)
ggplot(as.data.frame(UCBAdmissions), # Flatten the table
aes(y = Freq, axis1 = Gender, axis2 = Dept)) +
geom_alluvium(aes(fill = Admit), width = 1/12) +
geom_stratum(width = 1/12, fill = "black", color = "grey") +
geom_label(stat = "stratum", label.strata = TRUE) +
scale_x_discrete(limits = c("Gender", "Dept"), expand = c(.05, .05)) +
scale_fill_brewer(type = "qual", palette = "Set1") +
ggtitle("Admissions by sex and department: UCB") + labs(caption = "A ggalluvial example")
Now we are going to undertake our first interaction with GitHub from RStudio.
First a commit.
Stage all the changes and produce an informative commit message. My first post and the initial edits to blankslate or something like that.
To Netlify
And check out the deployment. In the meantime, we can, and probably should, copy off the deployment part from Netlify so we can check the status without logging in. We should also edit README.md to make the deploy button unique to our fork.
A Portfolio
Note
Blogdown can also allow you to link up your groovy shiny apps. I made one to run through an NFL season and show the win probabilities.
<iframe src="https://rwalkerwu.shinyapps.io/NFL-Scrapr/" width="1000" height="700" style="border: none;"></iframe>