<- readr::read_csv("the url") diamond_color
Lab 16: Joining tables
Note
In lab.qmd ## Lab 16
section
- Import the data at https://www.jaredlander.com/data/DiamondColors.csv. Call it
diamond_color
.
- Use
left_join()
to combine the data setdiamonds
in ggplot2 anddiamond_color
by the key variablecolor
.
- Select the variables
carat
,color
,Description
,Details
.
## Variable "color" in diamonds but "Color" in diamond_color
<- diamonds |>
joined_df _______(_______, by = c('color' = 'Color')) |> ## join
_______(_________________________________________) ## select
- Create a bar chart of the variable
color
.
# A tibble: 53,940 × 4
carat color Description Details
<dbl> <chr> <chr> <chr>
1 0.23 E Colorless Minute traces of color
2 0.21 E Colorless Minute traces of color
3 0.23 E Colorless Minute traces of color
4 0.29 I Near Colorless Slightly detectable color
5 0.31 J Near Colorless Slightly detectable color
6 0.24 J Near Colorless Slightly detectable color
7 0.24 I Near Colorless Slightly detectable color
8 0.26 H Near Colorless Color is dificult to detect
9 0.22 E Colorless Minute traces of color
10 0.23 H Near Colorless Color is dificult to detect
# ℹ 53,930 more rows