Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Dec 13, 2023
1 parent df7d2e1 commit a3d0334
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ the x, y, color, and size are mapped randomly to one of the variables in
the `mtcars` data.

---
output: moodlequiz::moodlequiz_cloze
output: moodlequiz::moodlequiz
title: Drawing a scatterplot
times: 5
topic: datavis
# keep_rmd: true
category: datavis
---

```{r set-up, include = FALSE}
## Scatterplots

```{r setup, include = FALSE}
library(tidyverse)
library(rlang)
knitr::opts_chunk$set(echo = FALSE,
Expand All @@ -54,8 +55,8 @@ the `mtcars` data.
fig.cap = "",
fig.align = "center")
library(moodlequiz)
library(exams)
```

```{r data}
cols <- colnames(mtcars)
cats <- c("cyl", "vs", "am", "gear", "carb")
Expand All @@ -66,8 +67,6 @@ the `mtcars` data.
size <- sample(setdiff(nums, c(x, y)), 1)
```



You have been asked to analyse the `mtcars` data. The variables and the class types of the data is shown below.

```{r, echo = TRUE, results = "show"}
Expand All @@ -77,11 +76,11 @@ the `mtcars` data.
As a starting point, you decide to draw a scatter plot for some variables. Complete the code below to get the target plot below:

```r
ggplot(mtcars, aes(x = `cloze schoice(cols, x)`,
y = `cloze schoice(cols, y)`,
color = factor(`cloze schoice(cols, color)`),
size = `cloze schoice(cols, size)`)) +
`cloze schoice(ls(envir = as.environment("package:ggplot2"), pattern = "^geom_"), "geom_point")`()
ggplot(mtcars, aes(x = `r cloze(x, cols)`,
y = `r cloze(y, cols)`,
color = factor(`r cloze(color, cols)`),
size = `r cloze(size, cols)`)) +
`r cloze("geom_point", ls(envir = as.environment("package:ggplot2"), pattern = "^geom_"))`()
```

```{r, results = "show"}
Expand Down

0 comments on commit a3d0334

Please sign in to comment.