Introduction to R and RStudio
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -736,8 +736,8 @@Version Control
Visualisation with ggplot2
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -445,11 +445,11 @@R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -470,7 +470,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R mapping = aes(x = bill_depth_mm, y = bill_length_mm) ) -Warning: Removed 2 rows containing missing values (`geom_point()`).
Note that we split the function into several lines. In R, any function has a name and is followed by parentheses. Inside the @@ -523,7 +524,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -536,7 +537,7 @@ Give me a hint
-
+
@@ -571,7 +573,7 @@ Challenge 1b
Show me the solution
-
+
@@ -605,7 +608,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -626,7 +630,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -637,7 +641,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -663,7 +668,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -677,7 +683,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -703,7 +710,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -728,7 +736,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -741,7 +749,7 @@ Give me a hint
-
+
@@ -776,7 +785,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -786,7 +795,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -818,7 +828,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -838,8 +849,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -855,8 +868,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -882,8 +897,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -903,7 +920,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -915,8 +932,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -950,7 +969,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -962,7 +981,7 @@ Give me a hint
-
+
R
@@ -977,10 +996,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1014,8 +1036,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1035,8 +1059,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1057,7 +1083,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1069,7 +1095,7 @@ Give me a hint
-
+
R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1160,8 +1188,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1542,8 +1542,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1106,8 +1106,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -385,7 +385,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
Give me a hint
-Challenge 1b
Show me the solution
-
+
@@ -605,7 +608,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -626,7 +630,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -637,7 +641,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -663,7 +668,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -677,7 +683,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -703,7 +710,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -728,7 +736,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -741,7 +749,7 @@ Give me a hint
-
+
@@ -776,7 +785,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -786,7 +795,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -818,7 +828,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -838,8 +849,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -855,8 +868,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -882,8 +897,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -903,7 +920,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -915,8 +932,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -950,7 +969,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -962,7 +981,7 @@ Give me a hint
-
+
R
@@ -977,10 +996,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1014,8 +1036,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1035,8 +1059,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1057,7 +1083,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1069,7 +1095,7 @@ Give me a hint
-
+
R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1160,8 +1188,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1542,8 +1542,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1106,8 +1106,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -385,7 +385,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R y = bill_length_mm, colour = island) ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Challenge 2
Show me the solution
-
+
R
@@ -637,7 +641,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -663,7 +668,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -677,7 +683,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -703,7 +710,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -728,7 +736,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -741,7 +749,7 @@ Give me a hint
-
+
@@ -776,7 +785,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -786,7 +795,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -818,7 +828,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -838,8 +849,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -855,8 +868,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -882,8 +897,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -903,7 +920,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -915,8 +932,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -950,7 +969,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -962,7 +981,7 @@ Give me a hint
-
+
R
@@ -977,10 +996,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1014,8 +1036,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1035,8 +1059,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1057,7 +1083,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1069,7 +1095,7 @@ Give me a hint
-
+
R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1160,8 +1188,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1542,8 +1542,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1106,8 +1106,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -385,7 +385,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -637,7 +641,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of possible values. This, like the data type of factor, is represented with @@ -663,7 +668,8 @@
R colour = species, size = year) ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
It might be even better to try another type of aesthetic, like shape, for categorical data like species.
@@ -677,7 +683,8 @@R colour = species, shape = species) ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Playing around with different aesthetic mappings until you find something that really makes the data “pop” is a good idea. A plot is @@ -703,7 +710,8 @@
R y = bill_length_mm), colour = "blue" ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
penguins
dataset and applies
@@ -728,7 +736,7 @@ Give me a hint
-alpha
takes a value from 0 (transparent) to 1
(solid).
Give me a hint
-Challenge 4
Show me the solution
-
+
R
@@ -786,7 +795,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -818,7 +828,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -838,8 +849,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -855,8 +868,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -882,8 +897,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -786,7 +795,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual @@ -818,7 +828,8 @@
R mapping = aes(x = species, y = bill_length_mm) ) -Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we will place the boxplots over jittered points to see the @@ -838,8 +849,10 @@
R mapping = aes(x = species, y = bill_length_mm) ) -Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_boxplot()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we had to specify the same mappings for two layers. To avoid it, you can @@ -855,8 +868,10 @@
R) + geom_jitter(aes(colour = island)) + geom_boxplot(alpha = .6) -Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_boxplot()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Challenge 5
Show me the solution
-
+
R
@@ -915,8 +932,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -950,7 +969,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -962,7 +981,7 @@ Give me a hint
-
+
R
@@ -977,10 +996,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1014,8 +1036,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1035,8 +1059,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1057,7 +1083,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1069,7 +1095,7 @@ Give me a hint
-
+
R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1160,8 +1188,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1542,8 +1542,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1106,8 +1106,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -385,7 +385,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -915,8 +932,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and @@ -950,7 +969,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -962,7 +981,7 @@ Give me a hint
-
+
R
@@ -977,10 +996,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1014,8 +1036,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1035,8 +1059,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1057,7 +1083,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1069,7 +1095,7 @@ Give me a hint
-
+
R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1160,8 +1188,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1542,8 +1542,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1106,8 +1106,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -385,7 +385,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Add another geom!
Give me a hint
-R
@@ -977,10 +996,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons @@ -1014,8 +1036,10 @@
R geom_smooth(method = "lm") + facet_wrap(~ sex) `geom_smooth()` using formula = 'y ~ x' -Warning: Removed 2 rows containing non-finite values (`stat_smooth()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_smooth()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1035,8 +1059,10 @@
R geom_smooth(method = "lm") + facet_wrap(~ species) `geom_smooth()` using formula = 'y ~ x' -Warning: Removed 2 rows containing non-finite values (`stat_smooth()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_smooth()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1069,7 +1095,7 @@ Give me a hint
-
+
R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1160,8 +1188,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1542,8 +1542,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1106,8 +1106,8 @@ Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -385,7 +385,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Add another facet variable with the +
Give me a hint
-R
@@ -1082,8 +1108,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/02-data-visualisation.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/03-data-subsetting.html b/03-data-subsetting.html
index 2cf9c409..20fd82b3 100644
--- a/03-data-subsetting.html
+++ b/03-data-subsetting.html
@@ -305,7 +305,7 @@
Subsetting data with dplyr
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -1542,8 +1542,8 @@Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/03-data-subsetting.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/04-data-sorting-pipes.html b/04-data-sorting-pipes.html
index b11ae4ee..95d2e545 100644
--- a/04-data-sorting-pipes.html
+++ b/04-data-sorting-pipes.html
@@ -306,7 +306,7 @@
Data sorting and pipes dplyr
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -1106,8 +1106,8 @@Wrap-up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/04-data-sorting-pipes.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/05-data-plotting-scales.html b/05-data-plotting-scales.html
index 8d8cc38c..3ef101da 100644
--- a/05-data-plotting-scales.html
+++ b/05-data-plotting-scales.html
@@ -302,7 +302,7 @@
Data visualisation and scales
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -385,7 +385,7 @@Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -397,7 +397,7 @@ Give me a hint
-
+
R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Try geom_boxplot
Give me a hint
-R
@@ -448,7 +448,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -536,7 +536,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
“coral” and “cyan” are built in colour names, that you can call directly. There are lots of these names, datanovia @@ -573,7 +573,7 @@
Challenge 4
Show me the solution
-
+
hexidecimal colour codes are often use in webdesign, and are a way of
coding red, blue and green. To explore colours in hexidecmial, there are
@@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
hexidecimal colour codes are often use in webdesign, and are a way of coding red, blue and green. To explore colours in hexidecmial, there are @@ -610,7 +610,7 @@
Challenge 5
Show me the solution
-
+
The order you provide the manual colours dictate which category gets
which colour.
@@ -648,7 +648,7 @@ Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -550,7 +550,7 @@ Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
The order you provide the manual colours dictate which category gets which colour.
@@ -648,7 +648,7 @@Challenge 6
Show me the solution
-
+
There is not single answer here, there are many different options.
The key difference between what we did before and this, is that the
@@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -709,7 +711,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
There is not single answer here, there are many different options. The key difference between what we did before and this, is that the @@ -666,7 +666,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -680,7 +681,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here we have chosen theme_minimal()
which strips axis
lines and the grey background, its more minimal. Explore some different
@@ -733,7 +736,7 @@
Challenge 7
Show me the solution
-
+
The classic theme is one often wanted by strict and old-school
journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -774,7 +778,7 @@ Challenge 8
Show me the solution
-
+
The void theme strips all axis and background, leaving the plot
alone. This is generally not a meaningful theme to use for publication,
@@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -874,8 +879,8 @@ Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
The classic theme is one often wanted by strict and old-school journals. Its very handy to have a short-cut to it.
@@ -750,7 +753,8 @@R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Show me the solution
-The void theme strips all axis and background, leaving the plot alone. This is generally not a meaningful theme to use for publication, @@ -793,7 +797,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Wrap up
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/05-data-plotting-scales.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/06-data-manipulation.html b/06-data-manipulation.html
index 16c569ef..9001bc01 100644
--- a/06-data-manipulation.html
+++ b/06-data-manipulation.html
@@ -302,7 +302,7 @@
Data manipulation with dplyr
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -550,7 +550,7 @@Challenge 1
Show me the solution
-
+
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -600,7 +600,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -690,7 +690,8 @@ R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That shows us clearly that we have grouped the penguins based on
their size. But there is this strange NA
in the plot
@@ -838,7 +839,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
That looks almost the same. The NA
’s are gone! That’s
not right. We cannot categorize values that are missing. It’s our last
@@ -872,7 +874,8 @@
R
WARNING
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Warning: Removed 2 rows containing missing values (`geom_point()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Here, we use the is.na()
, which is a special function in
R to detect NA
values. But it also has an !
in
@@ -900,7 +903,7 @@
Challenge 3
Show me the solution
-
+
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -955,7 +958,7 @@ Challenge 4
Show me the solution
-
+
Reshaping data with tidyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -437,7 +437,8 @@ R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we
are able to create sub-plots for all measurements easily with the same
@@ -950,9 +951,9 @@
WARNING
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
- {data} %>%
- dplyr::group_by(species, island, sex, year, name) %>%
- dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
+ {data} |>
+ dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name))
+ |>
dplyr::filter(n > 1L)
Data summaries with dplyr
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -1285,8 +1285,8 @@ OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -471,7 +471,7 @@ Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-Reshaping data with tidyr
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -437,7 +437,8 @@R
WARNING
-Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Warning: Removed 8 rows containing non-finite values (`stat_boxplot()`).
Warning: Removed 8 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
That’s pretty neat. By pivoting the data into this longer shape we are able to create sub-plots for all measurements easily with the same @@ -950,9 +951,9 @@
WARNING • Use `values_fn = list` to suppress this warning. • Use `values_fn = {summary_fun}` to summarise duplicates. • Use the following dplyr code to identify duplicates. - {data} %>% - dplyr::group_by(species, island, sex, year, name) %>% - dplyr::summarise(n = dplyr::n(), .groups = "drop") %>% + {data} |> + dplyr::summarise(n = dplyr::n(), .by = c(species, island, sex, year, name)) + |> dplyr::filter(n > 1L)
Data summaries with dplyr
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -1285,8 +1285,8 @@OUTPUT<
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/08-data-summaries.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/09-data-complex-pipelines.html b/09-data-complex-pipelines.html
index 56f3121a..6d8e4378 100644
--- a/09-data-complex-pipelines.html
+++ b/09-data-complex-pipelines.html
@@ -295,7 +295,7 @@
Complex data pipelines
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -471,7 +471,7 @@Challenge 1
Give me a hint
-
+
Try the n()
function.
@@ -483,7 +483,7 @@ Give me a hint
-
+
R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Try the n()
function.
Give me a hint
-R
@@ -534,7 +534,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -609,7 +609,7 @@ Challenge 3
Show me the solution
-
+
R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -721,7 +721,7 @@ Challenge 4
Give me a hint
-
+
Use facet_wrap()
@@ -733,7 +733,7 @@ Give me a hint
-
+
R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Give me a hint
-Use facet_wrap()
Give me a hint
-R
@@ -770,7 +770,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -854,7 +854,7 @@ Challenge 6
Show me the solution
-
+
R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -973,7 +973,7 @@ Challenge 7
Show me the solution
-
+
R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -1065,7 +1065,7 @@ Challenge 8
Show me the solution
-
+
R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -1106,7 +1106,7 @@ Challenge 9
Show me the solution
-
+
R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-R
@@ -1222,7 +1222,7 @@ Challenge 10
Give me a hint
-
+
You can type “theme” and press the tab button, to look at all the
possibilities.
@@ -1235,7 +1235,7 @@ Give me a hint
-
+
What themes did you find that you liked?
@@ -1290,7 +1290,7 @@ Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Give me a hint
-You can type “theme” and press the tab button, to look at all the possibilities.
@@ -1235,7 +1235,7 @@Give me a hint
-What themes did you find that you liked?
Challenge 11
Show me the solution
-
+
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -1321,7 +1321,7 @@ Challenge 12
Show me the solution
-
+
Data manipulation across columns
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -935,8 +935,8 @@ Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -373,8 +373,8 @@ Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/LICENSE.html b/LICENSE.html
index bfac998a..4c24509b 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -291,7 +291,7 @@
Licenses
- Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -425,8 +425,8 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html",
- "dateCreated": "2023-05-02",
- "dateModified": "2024-03-12",
+ "dateCreated": "2024-03-19",
+ "dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/aio.html b/aio.html
index 01e6b07f..6238f115 100644
--- a/aio.html
+++ b/aio.html
@@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-Data manipulation across columns
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -935,8 +935,8 @@Learning morePage not found
"creativeWorkStatus": "active",
"url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
"identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/404.html",
- "dateCreated": "2023-05-02",
+ "dateCreated": "2024-03-19",
"dateModified": "2024-03-19",
"datePublished": "2024-03-19"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index a499bdd7..12ef37b9 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -291,7 +291,7 @@
Contributor Code of Conduct
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -373,8 +373,8 @@Contributor Code of Conduct
"creativeWorkStatus": "active", "url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html", "identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/CODE_OF_CONDUCT.html", - "dateCreated": "2023-05-02", - "dateModified": "2024-03-12", + "dateCreated": "2024-03-19", + "dateModified": "2024-03-19", "datePublished": "2024-03-19" } diff --git a/LICENSE.html b/LICENSE.html index bfac998a..4c24509b 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -291,7 +291,7 @@Licenses
-Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
@@ -425,8 +425,8 @@Licenses
"creativeWorkStatus": "active", "url": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html", "identifier": "https://athanasiamo.github.io/r-tidyverse-4-datasets/LICENSE.html", - "dateCreated": "2023-05-02", - "dateModified": "2024-03-12", + "dateCreated": "2024-03-19", + "dateModified": "2024-03-19", "datePublished": "2024-03-19" } diff --git a/aio.html b/aio.html index 01e6b07f..6238f115 100644 --- a/aio.html +++ b/aio.html @@ -352,7 +352,7 @@
Content from Introduction to R and RStudio
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -774,7 +774,7 @@ Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Content from Introduction to R and RStudio
-
Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
Version Control
Content from Visualisation with ggplot2
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -923,11 +923,11 @@ R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Note that we split the function into several lines. In R, any
function has a name and is followed by parentheses. Inside the
@@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Content from Visualisation with ggplot2
-
Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
R# install.packages("tidyverse")
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
-✔ dplyr 1.1.2 ✔ readr 2.1.4
-✔ forcats 1.0.0 ✔ stringr 1.5.0
-✔ ggplot2 3.4.2 ✔ tibble 3.2.1
-✔ lubridate 1.9.2 ✔ tidyr 1.3.0
-✔ purrr 1.0.1
+✔ dplyr 1.1.4 ✔ readr 2.1.5
+✔ forcats 1.0.0 ✔ stringr 1.5.1
+✔ ggplot2 3.5.0 ✔ 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()
@@ -948,7 +948,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R mapping = aes(x = bill_depth_mm, y = bill_length_mm) ) -Warning: Removed 2 rows containing missing values (`geom_point()`).
Note that we split the function into several lines. In R, any function has a name and is followed by parentheses. Inside the @@ -1001,7 +1002,7 @@
Challenge 1a
Give me a hint
-
+
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
@@ -1014,7 +1015,7 @@ Give me a hint
-
+
@@ -1050,7 +1052,7 @@ Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
The* penguins
*dataset has a column called
year
, which should appear on the x-axis.
Give me a hint
-Challenge 1b
Show me the solution
-
+
@@ -1086,7 +1089,8 @@ R y = bill_length_mm,
colour = island)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1107,7 +1111,7 @@ Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R y = bill_length_mm, colour = island) ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Challenge 2
Show me the solution
-
+
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of
possible values. This, like the data type of factor, is represented with
@@ -1144,7 +1149,8 @@
R colour = species,
size = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
It might be even better to try another type of aesthetic, like shape,
for categorical data like species.
@@ -1158,7 +1164,8 @@ R colour = species,
shape = species)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Playing around with different aesthetic mappings until you find
something that really makes the data “pop” is a good idea. A plot is
@@ -1185,7 +1192,8 @@
R y = bill_length_mm),
colour = "blue"
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Once more, observe that the colour is now not mapped to any
particular variable from the penguins
dataset and applies
@@ -1210,7 +1218,7 @@
Challenge 3
Give me a hint
-
+
alpha
takes a value from 0 (transparent) to 1
(solid).
@@ -1223,7 +1231,7 @@ Give me a hint
-
+
@@ -1259,7 +1268,7 @@ Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1387,7 +1404,7 @@ Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -1118,7 +1122,8 @@ R y = bill_length_mm,
colour = year)
)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Island is categorical character variable with a discrete range of possible values. This, like the data type of factor, is represented with @@ -1144,7 +1149,8 @@
R colour = species, size = year) ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
It might be even better to try another type of aesthetic, like shape, for categorical data like species.
@@ -1158,7 +1164,8 @@R colour = species, shape = species) ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Playing around with different aesthetic mappings until you find something that really makes the data “pop” is a good idea. A plot is @@ -1185,7 +1192,8 @@
R y = bill_length_mm), colour = "blue" ) -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
penguins
dataset and applies
@@ -1210,7 +1218,7 @@ Give me a hint
-alpha
takes a value from 0 (transparent) to 1
(solid).
Give me a hint
-Challenge 4
Show me the solution
-
+
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual
@@ -1302,7 +1312,8 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we
will place the boxplots over jittered points to see the
@@ -1322,8 +1333,10 @@
R mapping = aes(x = species,
y = bill_length_mm)
)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we
had to specify the same mappings for two layers. To avoid it, you can
@@ -1339,8 +1352,10 @@
R) +
geom_jitter(aes(colour = island)) +
geom_boxplot(alpha = .6)
-Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_boxplot()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
You can still add layer-specific mappings or other arguments by
specifying them within individual geoms. Here, we’ve set the
@@ -1366,8 +1381,10 @@
R geom_point(alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
R
@@ -1269,7 +1278,8 @@ R mapping = aes(x = bill_depth_mm,
y = bill_length_mm),
alpha = 0.5)
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Controlling the transparency can be a great way to “mute” the visual @@ -1302,7 +1312,8 @@
R mapping = aes(x = species, y = bill_length_mm) ) -Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_boxplot()`).
Layers can be added on top of each other. In the following graph we will place the boxplots over jittered points to see the @@ -1322,8 +1333,10 @@
R mapping = aes(x = species, y = bill_length_mm) ) -Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_boxplot()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Now, this was slightly inefficient due to duplication of code - we had to specify the same mappings for two layers. To avoid it, you can @@ -1339,8 +1352,10 @@
R) + geom_jitter(aes(colour = island)) + geom_boxplot(alpha = .6) -Warning: Removed 2 rows containing non-finite values (`stat_boxplot()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_boxplot()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
Challenge 5
Show me the solution
-
+
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and
@@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
R
@@ -1399,8 +1416,10 @@ R alpha = 0.5) +
geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
In the graph above, each geom inherited all three mappings: x, y and @@ -1434,7 +1453,7 @@
Challenge 6
Give me a hint
-
+
Add another geom!
@@ -1446,7 +1465,7 @@ Give me a hint
-
+
R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons
@@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ sex)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") +
facet_wrap(~ species)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
@@ -1542,7 +1568,7 @@ Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Add another geom!
Give me a hint
-R
@@ -1461,10 +1480,13 @@ R geom_smooth(method = "lm",
colour = "black")
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+`geom_smooth()` using formula = 'y ~ x'
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Look at that! The data actually reveals something called the “simpsons @@ -1499,8 +1521,10 @@
R geom_smooth(method = "lm") + facet_wrap(~ sex) `geom_smooth()` using formula = 'y ~ x' -Warning: Removed 2 rows containing non-finite values (`stat_smooth()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_smooth()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
The facet’s take formula arguments, meaning they contain the
tilde
(~). The way often we think about it, trying to
@@ -1520,8 +1544,10 @@
R geom_smooth(method = "lm") + facet_wrap(~ species) `geom_smooth()` using formula = 'y ~ x' -Warning: Removed 2 rows containing non-finite values (`stat_smooth()`). -Warning: Removed 2 rows containing missing values (`geom_point()`). +Warning: Removed 2 rows containing non-finite outside the scale range +(`stat_smooth()`). +Warning: Removed 2 rows containing missing values or values outside the scale range +(`geom_point()`).
The NA’s still look weird, but its definitely better, I think.
Challenge 7
Give me a hint
-
+
Add another facet variable with the +
@@ -1554,7 +1580,7 @@ Give me a hint
-
+
R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
@@ -1588,7 +1616,7 @@ Wrap-up
Content from Subsetting data with dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -2780,7 +2808,7 @@ Wrap-up
-->
Content from Data sorting and pipes dplyr
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3527,7 +3555,7 @@ Wrap-up
-->
Content from Data visualisation and scales
-Last updated on 2024-03-12 |
+
Last updated on 2024-03-19 |
Edit this page
@@ -3610,7 +3638,7 @@ Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Add another facet variable with the +
Give me a hint
-R
@@ -1567,8 +1593,10 @@ R geom_smooth(method = "lm") +
facet_wrap(~ species + island)
`geom_smooth()` using formula = 'y ~ x'
-Warning: Removed 2 rows containing non-finite values (`stat_smooth()`).
-Warning: Removed 2 rows containing missing values (`geom_point()`).
+Warning: Removed 2 rows containing non-finite outside the scale range
+(`stat_smooth()`).
+Warning: Removed 2 rows containing missing values or values outside the scale range
+(`geom_point()`).
Wrap-up
Content from Subsetting data with dplyr
-
Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
Wrap-up -->
Content from Data sorting and pipes dplyr
-
Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
Wrap-up -->
Content from Data visualisation and scales
-
Last updated on 2024-03-12 | +
Last updated on 2024-03-19 | Edit this page
Challenge 1
Give me a hint
-
+
Try geom_boxplot
@@ -3622,7 +3650,7 @@ Give me a hint
-
+
R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Try geom_boxplot
Give me a hint
-R
@@ -3675,7 +3703,7 @@ Challenge 2
Show me the solution
-
+
Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
Show me the solution
-Learning the difference between using fill
and
colour
/color
can take a little time, but in
@@ -3765,7 +3793,7 @@
Challenge 3
Show me the solution
-
+
“coral” and “cyan” are built in colour names, that you can call
directly. There are lots of these names, datanovia
@@ -3803,7 +3831,7 @@
Challenge 4
Show me the solution
-
“coral” and “cyan” are built in colour names, that you can call directly. There are lots of these names, datanovia @@ -3803,7 +3831,7 @@