diff --git a/_quarto.yml b/_quarto.yml index b546c2e..9c13d75 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -3,9 +3,11 @@ project: render: - "*.qmd" - "!datasets/" + - "!assignments/" resources: - "assets/" - "datasets/" + - "assignments/" website: title: "SDS 366" @@ -34,6 +36,8 @@ website: - text: "Worksheets" menu: + - text: "Class 1: Intro to Quarto" + href: assignments/intro_to_Quarto.qmd - text: "Class 2: Aesthetic mappings" href: worksheets/aesthetic-mappings.qmd - text: "Class 3: Visualizing amounts" diff --git a/_site/assignments/HW1.pdf b/_site/assignments/HW1.pdf new file mode 100644 index 0000000..55e6799 Binary files /dev/null and b/_site/assignments/HW1.pdf differ diff --git a/_site/assignments/HW1.qmd b/_site/assignments/HW1.qmd new file mode 100644 index 0000000..64d8101 --- /dev/null +++ b/_site/assignments/HW1.qmd @@ -0,0 +1,36 @@ +--- +title: "Homework 1" +format: typst +editor: visual +--- + +```{r} +#| echo: false +#| message: false +# !! Do not edit this code chunk !! +library(tidyverse) +``` + +**This homework is due on Jan. 23, 2024 at 11:00pm. Please submit as a pdf file on Canvas.** + +**Problem 1: (8 pts)** Demonstrate basic command of Quarto document editing by creating a bulleted list with three items, a numbered list with three items, and a sentence that has one word in bold and one word in italics. + +*Your text goes here.* + +**Problem 2: (6 pts)** The `economics` dataset contains various time series data from the US economy: + +```{r} +economics +``` + +Use ggplot to make a line plot of the total population (`pop`, in thousands) versus time (column `date`). + +```{r} +# your code goes here +``` + +**Problem 3: (6 pts)** Again using the `economics` dataset, now make a scatter plot (using `geom_point()`) of the number of unemployed versus the total population (`pop`), and color points by date. + +```{r} +# your code goes here +``` diff --git a/_site/assignments/intro_to_Quarto.pdf b/_site/assignments/intro_to_Quarto.pdf new file mode 100644 index 0000000..65cf9a0 Binary files /dev/null and b/_site/assignments/intro_to_Quarto.pdf differ diff --git a/_site/assignments/intro_to_Quarto.qmd b/_site/assignments/intro_to_Quarto.qmd new file mode 100644 index 0000000..36f16ec --- /dev/null +++ b/_site/assignments/intro_to_Quarto.qmd @@ -0,0 +1,41 @@ +--- +title: "Intro to Quarto" +format: + typst: + fig-width: 4 + fig-height: 2.5 +editor: visual +--- + +All assignments in this class will be done via [Quarto documents.](https://quarto.org) Quarto documents are documents that combine text, code, and output, including figures. They are a great way to produce self-contained and documented statistical analyses. Quarto has support for a variety of popular programming languages for data analysis, including R and python. + +In this first worksheet, you will learn how to do some basic Quarto editing. After you have made a change to the document, press "Render" in R Studio and see what kind of a result you get. All assignments will be submitted as pdf files and therefore this Quarto document renders into a pdf as well. + +Edit only below this line. + +------------------------------------------------------------------------ + +## 1. Basic Markdown editing + +Try out basic editing features, as described here: . Write some text that is bold, and some that is in italics. Make a numbered list and a bulleted list. Make a nested list. Try the block-quote feature. + +Also try both the visual and the source editing mode and see which one you prefer. + +*Your text goes here.* + +## 2. Embedding R code + +R code embedded in R chunks will be executed and the output will be shown. + +```{r} +library(ggplot2) + +ggplot(mtcars, aes(disp, mpg)) + + geom_point() +``` + +Now you try it. If you know some ggplot, modify the above plot. For example, plot some other data columns (e.g., `hp`, `qsec`, `gear`), or add some color to the plot. If you don't know ggplot but know some other R, try that. If you don't know any R try basic mathematical expressions, such as `45 + 10` or `sqrt(15)`. + +```{r} +# Your R code goes here +``` diff --git a/_site/index.html b/_site/index.html index bb136c2..094b00d 100644 --- a/_site/index.html +++ b/_site/index.html @@ -170,6 +170,10 @@