Thanks to WP (Piazza #15) for delving into Google Calendar formatting
I’ve updated the course homepage to provide a CSV file with all course deadlines suitable for import to Google Calendar.
Course project description is now online
Detailed discussion of:
First step: by October 2nd, email me your group members.
Total enrollment: 46 = 33 (STA) + 13 (OPR)
Pre-Assignment 02: - 40 / 46 submitted - Ignore “5/10 grading” - limitation of Brightspace - I manually adjust
Pre-Assignment 03: - Before midnight: Available on website + Brightspace
Because this course is a double, I have resources to create a “bot” to help with course organization on GitHub.
Bot will begin to acknowledge completed MP#00 over the weekend.
Current name: CISSOID
: CIS and Statistics bot for Organizing Instructional Delivery
Better name suggestions very welcome!
What is Markdown?
Per Wikipedia: “Markdown is a light-weight, plain-text, markup language specification”
What is Markdown?
Other than text formatting, does Markdown ha[ve] any other us[]es?
On its own, Markdown is just text formatting (but that’s a lot!)
We will use Quarto which augments markdown for reproducible research. We can embed code-and its output-inside Markdown documents.
[W]hat documents use[] Markdown?
So much! Markdown is used by Bitbucket, GitHub, OpenStreetMap, Reddit, Stack Exchange, Drupal, ChatGPT, Discord, MS Teams and many more!
With tools like Pandoc/Quarto, Markdown can be rendered to:
[What is] the difference between [a] Code section and [a] Nested List[? A]re they just different ways of indenting?
No. Nested lists are ‘just’ text
Code formatting enables much more if rendering engine supports it:
[H]ow are we going to use Markdown?
All written work (mini-projects and final project) in this course will be submitted using Markdown (by way of Quarto).
Specifically: - Submission pages for 5 mini-projects - Individual reports for course project - Summary (team) report for final project
You are also encouraged (but not required) to use Markdown for presentation slides (like these!)
How can I create Tables in Markdown?
Markdown has two table syntaxes:
If you are using the advanced (“pipe table”) synatx, I suggest you use RStudio’s Visual editor mode. (DEMO!)
How to create images and links?
Basic hyperlinks look like this:
[link text](https://the.url/goes/here)
If you want to embed the contents of a link, prepend it with an exclamation point. This is most useful for images:
![Image Caption](https://the.url/goes/here.png)
You can even put a link inside an image to be fancy:
[![Elephant](elephant.png)](https://en.wikipedia.org/wiki/Elephant)
How to create images and links?
Quarto automatically embeds the results of plotting code:
Here, Quarto handles all the file creation and link targeting for us. If I change the code, the figure will change automatically.
Full description online
Quarto user guide is fantastic!
See also source for course materials.
If you haven’t already, install Quarto.
Create a simple PDF quarto document using the RStudio wizard.
(Note that you may need to install tinytex
for this to work properly, but Quarto should install it for you automatically.)
Create a 5 slide presentation showing the Houston housing market. This should include:
You may use the following code snippets:
if(!require("tidyverse")) install.packages("tidyverse")
library(tidyverse)
txhousing |> filter(city=="Houston") |>
group_by(year) |>
summarize(sales=sum(sales)) |>
ggplot(aes(x=year, y=sales)) +
geom_line() +
ggtitle("Annual Houses Sold in Houston, TX")
Recall that this code needs to be between three backticks on each end (and start with r
in curly braces as well.)
if(!require("tidyverse")) install.packages("tidyverse")
library(tidyverse)
txhousing |> filter(city=="Houston") |>
group_by(month) |>
summarize(avg_price=sum(volume) / sum(sales)) |>
mutate(month=factor(month.abb[month], levels=month.abb, ordered=TRUE)) |>
ggplot(aes(x=month, y=avg_price)) +
geom_bar(stat="identity") +
ggtitle("Average Price of Houses Sold in Texas by Month") +
xlab("Month") +
ylab("Average Sale Price") +
scale_y_continuous(labels = scales::dollar)
Recall that this code needs to be between three backticks on each end (and start with r
in curly braces as well.)
if(!require("tidyverse")) install.packages("tidyverse")
library(tidyverse)
txhousing |> filter(year==2015) |>
group_by(city) |>
summarize(avg_price=sum(volume) / sum(sales),
num_sales=sum(sales)) |>
slice_max(num_sales, n=10) |>
ggplot(aes(x=city, y=avg_price)) +
geom_bar(stat="identity") +
ggtitle("Average Price of Houses Sold in 2015 by City in Texas") +
xlab("City") +
ylab("Average Sale Price") +
scale_y_continuous(labels = scales::dollar)
Recall that this code needs to be between three backticks on each end (and start with r
in curly braces as well.)
View the Quarto Demo Slides and add one new element to your slides from the previous section.
In-class discussion of what a static web page is and the role of GitHub Pages as a static web server.
Professional programming is at least half looking things up; at beginning stages, the fraction is even higher.
So it’s important to know how to see help the smart way:
R
and its packages are no exception. Everything we will use in this class has solid documentation.Most programming challenges have been faced by somebody before, so Google it!
Tips:
R
or rstats
in your search queryStackOverflow
for specific code questions; blogs and course materials are better for “big picture” questionsProgramming fora, like StackOverflow
, are full of great resources. Most of what you need is already there. But if you need to ask a new question, make sure to create a minimal reproducible example
Make it easy for your helper to help you.
Pro-Tip: You’ll solve over 50% of your problems in trying to create an MRE.
Tips:
The reprex R
package helps with this: see this talk.
For this class, rely on Piazza!