diff --git a/.DS_Store b/.DS_Store index 4190f20..e2425d2 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/tutorials/.DS_Store b/tutorials/.DS_Store index c90d532..d245c1c 100644 Binary files a/tutorials/.DS_Store and b/tutorials/.DS_Store differ diff --git a/tutorials/css/bg6-01.png b/tutorials/css/bg6-01.png new file mode 100644 index 0000000..5ad44f5 Binary files /dev/null and b/tutorials/css/bg6-01.png differ diff --git a/tutorials/css/bg7-01.png b/tutorials/css/bg7-01.png new file mode 100644 index 0000000..6222a64 Binary files /dev/null and b/tutorials/css/bg7-01.png differ diff --git a/tutorials/css/bg8-01.png b/tutorials/css/bg8-01.png new file mode 100644 index 0000000..48bf39f Binary files /dev/null and b/tutorials/css/bg8-01.png differ diff --git a/tutorials/css/bg9-01.png b/tutorials/css/bg9-01.png new file mode 100644 index 0000000..07e16a1 Binary files /dev/null and b/tutorials/css/bg9-01.png differ diff --git a/tutorials/css/custom.css b/tutorials/css/custom.css index ce77290..8110329 100644 --- a/tutorials/css/custom.css +++ b/tutorials/css/custom.css @@ -26,7 +26,7 @@ p.caption { } body { - background-image: url('bg5.png'); + background-image: url('bg9-01.png'); background-attachment: fixed; background-size: 100%; } @@ -51,7 +51,7 @@ hr { code { background-color: #c34a79; - color: black; + color: white; font-family: Roboto Mono; } diff --git a/tutorials/css/r_first_then.png b/tutorials/css/r_first_then.png new file mode 100644 index 0000000..4df61f0 Binary files /dev/null and b/tutorials/css/r_first_then.png differ diff --git a/tutorials/css/we_belive_in_you.html b/tutorials/css/we_belive_in_you.html new file mode 100644 index 0000000..689b47c --- /dev/null +++ b/tutorials/css/we_belive_in_you.html @@ -0,0 +1,2582 @@ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Hello everyone! This tutorial was created by R Girls School Network to promote the use of R in secondary schools for girls.
+ +You don’t need to install R/RStudio locally to run these lessons. These interactive lessons relies on learnr package to create an interactive code chunks, where we will run, edit, or write our own code. An example is shown below with some pre-populated code. Give it a try and click the ‘Run Code’ button in the top right to see the outcome of this code to make a ggplot graph!
+mpg$class = with(mpg, reorder(class, hwy, median))
+
+p <- mpg %>%
+ ggplot( aes(x=class, y=hwy, fill=class)) +
+ geom_violin() +
+ xlab("class") +
+ theme(legend.position="none") +
+ xlab("")
+ p
+
+There will be occasions where you will be asked to “fill in the blanks” for practice but there were also a “Hint” and/or “Solution” button - in case get stuck. You can find the hint or solution by clicking on that button. Go a head and try it below, as if you are asked to update the point color to “orange” and the point size to 4 in this ggplot graph:
+ggplot(data = mtcars, aes(x = wt, y = mpg)) +
+ geom_point()
+
+ggplot(data = mtcars, aes(x = wt, y = mpg)) +
+ geom_point(color = "______", size = _)
+ggplot(data = mtcars, aes(x = wt, y = mpg)) +
+ geom_point(color = "orange", size = 4)
+This work was inspired by a tutorial made by the wonderful Allison Horst in R-Ladies Dammam & R-Ladies Tunis, which can be accessed in this repository.
+Throughout this tutorial we use different resources and packages, which includes:
+tidyverse: Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686
dplyr: Hadley Wickham, Romain François, Lionel Henry and Kirill Müller (2020). dplyr: A Grammar of Data Manipulation. R package version 1.0.2. https://CRAN.R-project.org/package=dplyr
ggplot2: H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016.
learnr: Barret Schloerke, JJ Allaire and Barbara Borges (2020). learnr: Interactive Tutorials for R. R package version. 0.10.1. https://CRAN.R-project.org/package=learnr
The Turing Way Community. (2021, November 10). The Turing Way: A handbook for reproducible, ethical and collaborative research. Zenodo. http://doi.org/10.5281/zenodo.3233853
All materials are licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0), which means you can use, modify it and adapt it with attribution.
+We genrate a DOI to the lessons through Zenodo archive using DOI: 10.5281/zenodo.6436861. DOIs allow us to archive this open source project and ensure that the work is tracked through metrics. If you use any of our lessons, please include the following attribution:
+++RGirls Community. (2022, April 10). RGirls Lessons. Zenodo. https://doi.org/10.5281/zenodo.6436861
+
tidyverse
First we will tell R to generate a sequence.
-This is how you generate a sequence of numbers from 1 to 100 where the terms increase by 1. +This is how you generate a sequence of numbers from 1 to 100 where the terms increase by 1.
seq(from=1,to=100,by=1)
Use the above example R code in chunk1 to generate the following sequences. Remember to edit the numbers in the code.
-Q1 Generate a sequence from 1 to 100 where the terms increase by 10
Q2 Generate a sequence from 5 to 95 where the terms increase by 5.
Q3 Generate a sequence from 3 to 399 where the terms increase by 4.
Q4 Generate a sequence from 1 to 9 where the terms increase by 3.
Now we will generate a sequence that starts from a number and goes up to the nth term, where the nth term is for example 10.
-For example a sequence from 1 where the terms go up by 1 till the 10th term. +For example a sequence from 1 where the terms go up by 1 till the 10th term.
seq(from=1, length.out=10, by=1)
Use the above example R code in chunk6 to generate the following sequences.
Knit your document after each question to check your sequence.
-Q1 Generate a sequence from 1 where the terms go up by 4 up to the 100th term
Q2 Generate a sequence from 5 where the terms go up by 10 up to the 89th term
Q3 Generate a sequence from 3 where the terms go up by 3 up to the 33rd term
So the terms have increased by a particular number, but we can also decrease by a number and produce a backward sequence.
@@ -212,54 +270,55 @@Use the above example R code in chunk10 to answer the following questions.
Knit your document after each question to check your sequence is correct.
-Q1 Generate a sequence that goes down from 50 to 0 where the terms go down by 5.
Q2 Generate a sequence from 10 to -10 where the terms go down by 1.
Q3 Generate a sequence that goes down from 20 to 10 where the terms go down by 2.
tidyverse
This is how you find the difference between the terms in a sequence.
The sequence is 3, 7, 11, 15.
Knit your document to see the sequence generated by the R code in chunk1.
@@ -269,24 +328,23 @@The R code tells you the difference between each number in the sequence.
-Now use the above example R code in chunk1 to find the difference between the terms in the following sequences
Knit the document after each question to see the answer. Check your answer.
-Q1 2,7,12,17,22 +Q1 2,7,12,17,22
Q2 3,9,15,21,27
Q3 1,4,10,19,31
Now we will see if a number lies in a sequence.
@@ -300,14 +358,14 @@Use the above example R code in chunk5 to answer the following questions.
Remember to tell R how many terms you want it to generate by editing the length.out number. Remember to tell R what numbers to look for in the sequence by editing the x== numbers.
-Q1 Generate the first 100 terms of the sequence 3,7,11,15 and see if the numbers 117 and 395 lie in the sequence. Do they?
Now we will find the missing number in a sequence. Our sequence is 4, ?, 16, 22. Term 2 is missing. So we generate the sequence based on what we know which is that the difference between 16 and 22 is 6. The computer will put in the missing term.
@@ -330,23 +388,23 @@Use Pythagoras’ Theorem to find the lengths of missing sides of a right angle triangle
tidyverse
Write the R code to work out the missing side
Calculate the missing side
First knit the document so that you can see images of the triangles and the formulae you will be working with.
This is a worked example for you to follow.
The formula to find c is: \[c = \sqrt{a^2 + b^2}\]
@@ -382,7 +441,6 @@The length of \(c = r round(c,2)\) cm
The inline code above tells R to round c to 2 decimal places. Knit the document to check this.
-Run R code chunk3. This will draw you the triangle with the length of side c missing.
@@ -486,27 +544,27 @@tidyverse
This is a worked example for you to follow.
@@ -531,8 +590,8 @@Now close the image by clicking on the X to the right of the graph
Write your own code to draw the following graphs.
Use code chunk1 from the example above to help you.
Drawing more than one line on a graph helps us to compare the lines and see what is the same and what is different. Here is a worked example for four different lines.
@@ -578,8 +636,9 @@Question: From the graph what looks the same and what looks different about these lines?
Answer:
Draw the following lines on a graph
Plotting and finding the equations of straight line graphs \(y=mx+c\)
tidyverse
This is a worked example for you to follow.
We will show you how to plot the line graph for y=2x + 5.
We will now see what happens when you change the intercept c to a negative value.
Question: What is the same and what is different about these lines?
Knit your document and check the output.
Draw these lines on a graph. Use the R code from chunk2 to help you. Remember to update the code with these new lines.
Question: What is the same and what is different about these lines?
Now we will investigate m (the gradient). Draw these lines on a graph. Use R code from chunk2 to help you.
Run the code and knit the document.
Question: What is the same and what is different about these lines?
cat ("Q1 In the equation y=mx+c, what happens when you change c?")
cat ("Q2 What happens when you change m?")
Write down the equations of the following four lines on the graph below.
Knit the document to get a good view of the graph.
tidyverse
astsa
box plot, minimum, maximum, lower quartile, median, upper quartile, five number summary, inter-quartile range, range
The shortest person is a girl
The tallest person is a boy
Half the boys are over 172 cm tall
Half the girls are under 165cm tall
Half the girls are under 165cm tall + + + + - +
- +