Matthew Beckman & Justin Post June 25, 2021
Here, we join an analysis already in progress…
## from instructions before workshop, if needed:
# devtools::install_github("mdbeckman/dcData")
# packages
library(tidyverse)
library(dcData)
# data intake
data("BabyNames", package = "dcData")
BabyNamesSupp <-
read_csv("https://jbpost2.github.io/TeachingWithR/datasets/BabyNamesSupp.csv")
# 2020 data intake was issued as a challenge task only
BabyNames2020 <-
read_csv("https://jbpost2.github.io/TeachingWithR/datasets/yob2020.txt",
col_names = FALSE)
# inspecting the data
head(BabyNamesSupp)
tail(BabyNamesSupp)
Note: you might hang onto the RStudio default text provided in the new R Markdown file for the moment… it’s packed with tiny examples that will come in handy!
We’ll be investigating the popularity of names in the US each year. Choose a few (4-5) names to investigate to you–friends, family, TV character, colleagues in the workshop!
Task 1: “Knit” the document to render the initial HTML document
Task 2: update yaml header as necessary to include an informative title, author name, & relevant date.
---
title: "Add a title"
author: "Add your name"
date: "Pick a date"
output: html_document
---
tidyverse
and dcData
packagesBabyNames
from dcData
packageBabyNamesSupp.csv
using read_csv( )
now()
directly from lubridate
package INLINE for the time stamp.
R Markdown is a flexible syntax that can render the same .Rmd (text)
file in different formats. If you know the syntax, you can update the
output:
directly in the yaml header. RStudio provides a shortcut as a
(tiny) menu arrow next to the “Knit (yarn)” icon revealing a few common
choices.
output: word_document
”tinytex::install_tinytex()
output: pdf_document
output: html_notebook
output: html_document
[coming up next…]