1 + 1[1] 2
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
1 + 1[1] 2
You can add options to executable code like this
[1] 4
The echo: false option disables the printing of code (only output is displayed).
/
library(tidyverse)── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.2.1 ✔ readr 2.2.0
✔ forcats 1.0.1 ✔ stringr 1.6.0
✔ ggplot2 4.0.3 ✔ tibble 3.3.1
✔ lubridate 1.9.5 ✔ tidyr 1.3.2
✔ purrr 1.2.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
library(dslabs)
library(treemap)pop_by_continent_2007 <- gapminder %>%
filter(year == 2007) %>%
group_by(continent) %>%
summarise(total_population = sum(population, na.rm = TRUE))
print(pop_by_continent_2007)# A tibble: 5 × 2
continent total_population
<fct> <dbl>
1 Africa 948156290
2 Americas 911419886
3 Asia 3911346015
4 Europe 730984863
5 Oceania 34130212
treemap(
pop_by_continent_2007,
index = "continent",
vSize = "total_population",
title = "population by continent 2007"
)