7  Test

7.1 Standards

7.1.1 For displaying figures:

7.1.2 For displaying code and even variable names

demo <- function(x) variable_2

7.1.3 For sizing graphs and code-generated plots

  • You can specify out-height or out-width as either pixels, inches, or percentages
  • You can specify both using different units
  • If you specify only one, the other should default to “auto” which keeps the figured scaled as in the original
Code
plot(pressure)

7.1.4 For code annotation

Code
library(tidyverse)
1
make a df
2
glimpse a df
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Code
1d <- tibble (x = 1:5) |>
2  glimpse()
Rows: 5
Columns: 1
$ x <int> 1, 2, 3, 4, 5

7.1.5 For displaying color (like red questions)

this sentence is in red

This is an alternative method but more complex: I love R.

red yellow green blue

yellow background for better contrast

7.1.6 Callouts for questions

8 This is the question you want displayed?

Here’s the answer! This can be as long as you want and contain text, code, output etc

8.0.1 Conditional Content

Use divs to specify content to only appear in certain formats:

Will only appear in HTML.