penguins_new <- penguins |>
group_by(island) |>
summarise(mean_bill = mean(bill_length_mm, na.rm = T))
penguins_new
# A tibble: 3 × 2
island mean_bill
<fct> <dbl>
1 Biscoe 45.3
2 Dream 44.2
3 Torgersen 39.0
Lecture 8
NC State University
ST 295 - Spring 2025
2025-02-04
– Have you cloned the today’s AE repo?
– Are you keeping up with prepare material?
– Homework-1 is graded!
– Homework-2 is live! Due Feb 10th at 11:59
-- Late window Feb 11th at 11:59
It went really well! Nice work! Here are some things to think about…
Why?
Unless otherwise asked, please practice writing code in a single pipeline!
What’s wrong with the following code below?
To change the name of the legend, make sure that your labs()
argument matches what is in your aes()
function!
Read these logical operators as a sentence:
– x <= y
– x == y
– x & y
– x | y
– is.na(x)
– x %in% y
– x <= y
x less than or equal to y
– x == y
x exactly equal to y
– x & y
x and y
– x | y
x or y
– is.na(x)
is x NA
– x %in% y x in y
==
vs %in%
Change %in%
to ==
. What happens?
filter()
mutate()
count()
summarise()
– The sheer volume of information is sometimes referred to as “messy” data, because it’s hard to make sense of it all.
Data merging is the process of combining two or more data sets into a single data set. Most often, this process is necessary when you have raw data stored in multiple files, worksheets, or data tables, that you want to analyze together.
– Left Join
– Inner Join
– Right Join
– Full Join
– Joining Data
– Recreate:
– This is important! Data are messy!
– Think carefully about the join you use