From beb48005b34eb45f8bb7f5032ea85c0d8d38f732 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 7 May 2024 00:22:04 +0000 Subject: [PATCH] differences for PR #889 --- 01-rstudio-intro.md | 52 +- 02-project-intro.md | 8 +- 03-seeking-help.md | 14 +- 04-data-structures-part1.md | 156 ++--- 05-data-structures-part2.md | 48 +- 06-data-subsetting.md | 130 ++-- 07-control-flow.md | 22 +- 08-plot-ggplot2.md | 10 +- 09-vectorization.md | 48 +- 10-functions.md | 20 +- 11-writing-data.md | 4 +- 12-dplyr.md | 36 +- 13-tidyr.md | 38 +- config.yaml | 95 --- fig/06-rmd-generate-figures.sh | 0 fig/12-plyr-generate-figures.sh | 0 md5sum.txt | 50 +- renv.lock | 1021 ------------------------------- 18 files changed, 318 insertions(+), 1434 deletions(-) delete mode 100644 config.yaml mode change 100755 => 100644 fig/06-rmd-generate-figures.sh mode change 100755 => 100644 fig/12-plyr-generate-figures.sh delete mode 100644 renv.lock diff --git a/01-rstudio-intro.md b/01-rstudio-intro.md index 0124a77d6..b6ca3b0a9 100644 --- a/01-rstudio-intro.md +++ b/01-rstudio-intro.md @@ -150,7 +150,7 @@ The simplest thing you could do with R is to do arithmetic: 1 + 100 ``` -```{.output} +```output [1] 101 ``` @@ -205,7 +205,7 @@ From highest to lowest precedence: 3 + 5 * 2 ``` -```{.output} +```output [1] 13 ``` @@ -218,7 +218,7 @@ intend. (3 + 5) * 2 ``` -```{.output} +```output [1] 16 ``` @@ -243,7 +243,7 @@ Really small or large numbers get a scientific notation: 2/10000 ``` -```{.output} +```output [1] 2e-04 ``` @@ -257,7 +257,7 @@ You can write numbers in scientific notation too: 5e3 # Note the lack of minus here ``` -```{.output} +```output [1] 5000 ``` @@ -279,7 +279,7 @@ doesn't require an argument, whereas for the next set of mathematical functions sin(1) # trigonometry functions ``` -```{.output} +```output [1] 0.841471 ``` @@ -288,7 +288,7 @@ sin(1) # trigonometry functions log(1) # natural logarithm ``` -```{.output} +```output [1] 0 ``` @@ -297,7 +297,7 @@ log(1) # natural logarithm log10(10) # base-10 logarithm ``` -```{.output} +```output [1] 1 ``` @@ -306,7 +306,7 @@ log10(10) # base-10 logarithm exp(0.5) # e^(1/2) ``` -```{.output} +```output [1] 1.648721 ``` @@ -336,7 +336,7 @@ We can also do comparisons in R: 1 == 1 # equality (note two equals signs, read as "is equal to") ``` -```{.output} +```output [1] TRUE ``` @@ -345,7 +345,7 @@ We can also do comparisons in R: 1 != 2 # inequality (read as "is not equal to") ``` -```{.output} +```output [1] TRUE ``` @@ -354,7 +354,7 @@ We can also do comparisons in R: 1 < 2 # less than ``` -```{.output} +```output [1] TRUE ``` @@ -363,7 +363,7 @@ We can also do comparisons in R: 1 <= 1 # less than or equal to ``` -```{.output} +```output [1] TRUE ``` @@ -372,7 +372,7 @@ We can also do comparisons in R: 1 > 0 # greater than ``` -```{.output} +```output [1] TRUE ``` @@ -381,7 +381,7 @@ We can also do comparisons in R: 1 >= -9 # greater than or equal to ``` -```{.output} +```output [1] TRUE ``` @@ -424,7 +424,7 @@ in something called a **variable**. `x` now contains the **value** `0.025`: x ``` -```{.output} +```output [1] 0.025 ``` @@ -439,7 +439,7 @@ have appeared. Our variable `x` can be used in place of a number in any calculat log(x) ``` -```{.output} +```output [1] -3.688879 ``` @@ -550,7 +550,7 @@ same data type. For example: 1:5 ``` -```{.output} +```output [1] 1 2 3 4 5 ``` @@ -558,7 +558,7 @@ same data type. For example: 2^(1:5) ``` -```{.output} +```output [1] 2 4 8 16 32 ``` @@ -567,7 +567,7 @@ x <- 1:5 2^x ``` -```{.output} +```output [1] 2 4 8 16 32 ``` @@ -587,7 +587,7 @@ ls() ``` -```{.output} +```output [1] "x" "y" ``` @@ -611,7 +611,7 @@ If we type `ls` by itself, R prints a bunch of code instead of a listing of obje ls ``` -```{.output} +```output function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, pattern, sorted = TRUE) { @@ -643,7 +643,7 @@ function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, } else all.names } - + ``` @@ -658,7 +658,7 @@ created earlier contains 1, 2, 3, 4, 5: x ``` -```{.output} +```output [1] 1 2 3 4 5 ``` @@ -694,7 +694,7 @@ If instead we use `<-`, there will be unintended side effects, or you may get an rm(list <- ls()) ``` -```{.error} +```error Error in rm(list <- ls()): ... must contain names or character strings ``` @@ -804,7 +804,7 @@ One way of answering this question in R is to use the `>` to set up the followin mass > age ``` -```{.output} +```output [1] TRUE ``` diff --git a/02-project-intro.md b/02-project-intro.md index 56fed2799..5a8c5d428 100644 --- a/02-project-intro.md +++ b/02-project-intro.md @@ -189,8 +189,8 @@ By running these commands in the shell: ls -lh data/gapminder_data.csv ``` -```{.output} --rw-r--r-- 1 runner docker 80K Apr 12 01:44 data/gapminder_data.csv +```output +-rw-r--r-- 1 runner docker 80K May 7 00:20 data/gapminder_data.csv ``` The file size is 80K. @@ -200,7 +200,7 @@ The file size is 80K. wc -l data/gapminder_data.csv ``` -```{.output} +```output 1705 data/gapminder_data.csv ``` @@ -211,7 +211,7 @@ There are 1705 lines. The data looks like: head data/gapminder_data.csv ``` -```{.output} +```output country,year,pop,continent,lifeExp,gdpPercap Afghanistan,1952,8425333,Asia,28.801,779.4453145 Afghanistan,1957,9240934,Asia,30.332,820.8530296 diff --git a/03-seeking-help.md b/03-seeking-help.md index 438790423..828a4c6f5 100644 --- a/03-seeking-help.md +++ b/03-seeking-help.md @@ -159,7 +159,7 @@ be copied and pasted by others into their own R session. sessionInfo() ``` -```{.output} +```output R version 4.3.3 (2024-02-29) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 22.04.4 LTS @@ -181,7 +181,7 @@ attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): -[1] compiler_4.3.3 tools_4.3.3 yaml_2.3.8 knitr_1.45 xfun_0.43 +[1] compiler_4.3.3 tools_4.3.3 yaml_2.3.8 knitr_1.46 xfun_0.43 [6] renv_1.0.7 evaluate_0.23 ``` @@ -255,7 +255,7 @@ e.g. paste(c("a","b"), "c") ``` -```{.output} +```output [1] "a c" "b c" ``` @@ -263,7 +263,7 @@ paste(c("a","b"), "c") paste(c("a","b"), "c", ",") ``` -```{.output} +```output [1] "a c ," "b c ," ``` @@ -271,7 +271,7 @@ paste(c("a","b"), "c", ",") paste(c("a","b"), "c", sep = ",") ``` -```{.output} +```output [1] "a,c" "b,c" ``` @@ -279,7 +279,7 @@ paste(c("a","b"), "c", sep = ",") paste(c("a","b"), "c", collapse = "|") ``` -```{.output} +```output [1] "a c|b c" ``` @@ -287,7 +287,7 @@ paste(c("a","b"), "c", collapse = "|") paste(c("a","b"), "c", sep = ",", collapse = "|") ``` -```{.output} +```output [1] "a,c|b,c" ``` diff --git a/04-data-structures-part1.md b/04-data-structures-part1.md index 2dbd076d2..66a838662 100644 --- a/04-data-structures-part1.md +++ b/04-data-structures-part1.md @@ -73,7 +73,7 @@ cats <- read.csv(file = "data/feline-data.csv") cats ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 1 2 black 5.0 0 @@ -128,7 +128,7 @@ them using the `$` operator: cats$weight ``` -```{.output} +```output [1] 2.1 5.0 3.2 ``` @@ -136,7 +136,7 @@ cats$weight cats$coat ``` -```{.output} +```output [1] "calico" "black" "tabby" ``` @@ -148,7 +148,7 @@ We can do other operations on the columns: cats$weight + 2 ``` -```{.output} +```output [1] 4.1 7.0 5.2 ``` @@ -156,7 +156,7 @@ cats$weight + 2 paste("My cat is", cats$coat) ``` -```{.output} +```output [1] "My cat is calico" "My cat is black" "My cat is tabby" ``` @@ -167,7 +167,7 @@ But what about cats$weight + cats$coat ``` -```{.error} +```error Error in cats$weight + cats$coat: non-numeric argument to binary operator ``` @@ -185,7 +185,7 @@ data something is: typeof(cats$weight) ``` -```{.output} +```output [1] "double" ``` @@ -197,7 +197,7 @@ For historic reasons, `double` is also called `numeric`. typeof(3.14) ``` -```{.output} +```output [1] "double" ``` @@ -205,7 +205,7 @@ typeof(3.14) typeof(1L) # The L suffix forces the number to be an integer, since by default R uses float numbers ``` -```{.output} +```output [1] "integer" ``` @@ -213,7 +213,7 @@ typeof(1L) # The L suffix forces the number to be an integer, since by default R typeof(1+1i) ``` -```{.output} +```output [1] "complex" ``` @@ -221,7 +221,7 @@ typeof(1+1i) typeof(TRUE) ``` -```{.output} +```output [1] "logical" ``` @@ -229,7 +229,7 @@ typeof(TRUE) typeof('banana') ``` -```{.output} +```output [1] "character" ``` @@ -263,7 +263,7 @@ cats <- read.csv(file="data/feline-data_v2.csv") typeof(cats$weight) ``` -```{.output} +```output [1] "character" ``` @@ -275,7 +275,7 @@ we did on them before, we run into trouble: cats$weight + 2 ``` -```{.error} +```error Error in cats$weight + 2: non-numeric argument to binary operator ``` @@ -295,7 +295,7 @@ is written by the `str()` function: str(cats) ``` -```{.output} +```output 'data.frame': 4 obs. of 3 variables: $ coat : chr "calico" "black" "tabby" "tabby" $ weight : chr "2.1" "5" "3.2" "2.3 or 2.4" @@ -340,7 +340,7 @@ my_vector <- vector(length = 3) my_vector ``` -```{.output} +```output [1] FALSE FALSE FALSE ``` @@ -355,7 +355,7 @@ another_vector <- vector(mode='character', length=3) another_vector ``` -```{.output} +```output [1] "" "" "" ``` @@ -366,7 +366,7 @@ You can check if something is a vector: str(another_vector) ``` -```{.output} +```output chr [1:3] "" "" "" ``` @@ -381,7 +381,7 @@ empty character strings. If we similarly do str(cats$weight) ``` -```{.output} +```output num [1:3] 2.1 5 3.2 ``` @@ -423,7 +423,7 @@ combine_vector <- c(2,6,3) combine_vector ``` -```{.output} +```output [1] 2 6 3 ``` @@ -446,7 +446,7 @@ coercion_vector <- c('a', TRUE) coercion_vector ``` -```{.output} +```output [1] "a" "TRUE" ``` @@ -455,7 +455,7 @@ another_coercion_vector <- c(0, TRUE) another_coercion_vector ``` -```{.output} +```output [1] 0 1 ``` @@ -471,7 +471,7 @@ example, combining `logical` and `character` transforms the result to c('a', TRUE) ``` -```{.output} +```output [1] "a" "TRUE" ``` @@ -487,7 +487,7 @@ character_vector_example <- c('0','2','4') character_vector_example ``` -```{.output} +```output [1] "0" "2" "4" ``` @@ -496,7 +496,7 @@ character_coerced_to_double <- as.double(character_vector_example) character_coerced_to_double ``` -```{.output} +```output [1] 0 2 4 ``` @@ -505,7 +505,7 @@ double_coerced_to_logical <- as.logical(character_coerced_to_double) double_coerced_to_logical ``` -```{.output} +```output [1] FALSE TRUE TRUE ``` @@ -527,7 +527,7 @@ using the `as.logical` function: cats$likes_string ``` -```{.output} +```output [1] 1 0 1 ``` @@ -536,7 +536,7 @@ cats$likes_string <- as.logical(cats$likes_string) cats$likes_string ``` -```{.output} +```output [1] TRUE FALSE TRUE ``` @@ -731,7 +731,7 @@ ab_vector <- c('a', 'b') ab_vector ``` -```{.output} +```output [1] "a" "b" ``` @@ -740,7 +740,7 @@ combine_example <- c(ab_vector, 'SWC') combine_example ``` -```{.output} +```output [1] "a" "b" "SWC" ``` @@ -752,7 +752,7 @@ mySeries <- 1:10 mySeries ``` -```{.output} +```output [1] 1 2 3 4 5 6 7 8 9 10 ``` @@ -760,7 +760,7 @@ mySeries seq(10) ``` -```{.output} +```output [1] 1 2 3 4 5 6 7 8 9 10 ``` @@ -768,7 +768,7 @@ seq(10) seq(1,10, by=0.1) ``` -```{.output} +```output [1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 [16] 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 [31] 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 @@ -786,7 +786,7 @@ sequence_example <- 20:25 head(sequence_example, n=2) ``` -```{.output} +```output [1] 20 21 ``` @@ -794,7 +794,7 @@ head(sequence_example, n=2) tail(sequence_example, n=4) ``` -```{.output} +```output [1] 22 23 24 25 ``` @@ -802,7 +802,7 @@ tail(sequence_example, n=4) length(sequence_example) ``` -```{.output} +```output [1] 6 ``` @@ -810,7 +810,7 @@ length(sequence_example) typeof(sequence_example) ``` -```{.output} +```output [1] "integer" ``` @@ -822,7 +822,7 @@ first_element <- sequence_example[1] first_element ``` -```{.output} +```output [1] 20 ``` @@ -834,7 +834,7 @@ sequence_example[1] <- 30 sequence_example ``` -```{.output} +```output [1] 30 21 22 23 24 25 ``` @@ -872,7 +872,7 @@ list_example <- list(1, "a", TRUE, 1+4i) list_example ``` -```{.output} +```output [[1]] [1] 1 @@ -894,7 +894,7 @@ elements: str(list_example) ``` -```{.output} +```output List of 4 $ : num 1 $ : chr "a" @@ -915,7 +915,7 @@ To retrieve one of the elements of a list, use the **double bracket**: list_example[[2]] ``` -```{.output} +```output [1] "a" ``` @@ -928,7 +928,7 @@ another_list <- list(title = "Numbers", numbers = 1:10, data = TRUE ) another_list ``` -```{.output} +```output $title [1] "Numbers" @@ -947,7 +947,7 @@ We can access single elements by an additional way! another_list$title ``` -```{.output} +```output [1] "Numbers" ``` @@ -976,7 +976,7 @@ The way to retrieve elements is different, though: pizza_price["pizzasubito"] ``` -```{.output} +```output pizzasubito 5.64 ``` @@ -988,7 +988,7 @@ The approach used for the list does not work: pizza_price$pizzafresh ``` -```{.error} +```error Error in pizza_price$pizzafresh: $ operator is invalid for atomic vectors ``` @@ -1005,7 +1005,7 @@ If you are only interested in the names, use the `names()` function: names(pizza_price) ``` -```{.output} +```output [1] "pizzasubito" "pizzafresh" "callapizza" ``` @@ -1017,7 +1017,7 @@ possible for names: names(pizza_price)[3] ``` -```{.output} +```output [1] "callapizza" ``` @@ -1026,7 +1026,7 @@ names(pizza_price)[3] <- "call-a-pizza" pizza_price ``` -```{.output} +```output pizzasubito pizzafresh call-a-pizza 5.64 6.60 4.50 ``` @@ -1106,7 +1106,7 @@ data frame: cats ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 TRUE 2 black 5.0 FALSE @@ -1121,7 +1121,7 @@ if we run: typeof(cats) ``` -```{.output} +```output [1] "list" ``` @@ -1144,7 +1144,7 @@ like any other list, but as a table? class(cats) ``` -```{.output} +```output [1] "data.frame" ``` @@ -1166,7 +1166,7 @@ we have seen already, each column of data.frame is a vector. cats$coat ``` -```{.output} +```output [1] "calico" "black" "tabby" ``` @@ -1174,7 +1174,7 @@ cats$coat cats[,1] ``` -```{.output} +```output [1] "calico" "black" "tabby" ``` @@ -1182,7 +1182,7 @@ cats[,1] typeof(cats[,1]) ``` -```{.output} +```output [1] "character" ``` @@ -1190,7 +1190,7 @@ typeof(cats[,1]) str(cats[,1]) ``` -```{.output} +```output chr [1:3] "calico" "black" "tabby" ``` @@ -1202,7 +1202,7 @@ thus can be composed of elements of different types. cats[1,] ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 TRUE ``` @@ -1211,7 +1211,7 @@ cats[1,] typeof(cats[1,]) ``` -```{.output} +```output [1] "list" ``` @@ -1219,7 +1219,7 @@ typeof(cats[1,]) str(cats[1,]) ``` -```{.output} +```output 'data.frame': 1 obs. of 3 variables: $ coat : chr "calico" $ weight : num 2.1 @@ -1254,7 +1254,7 @@ Try out these examples and explain what is returned by each one. cats[1] ``` -```{.output} +```output coat 1 calico 2 black @@ -1270,7 +1270,7 @@ first column of the data frame. cats[[1]] ``` -```{.output} +```output [1] "calico" "black" "tabby" ``` @@ -1282,7 +1282,7 @@ it is the contents of the first column, a *vector* of type *character*. cats$coat ``` -```{.output} +```output [1] "calico" "black" "tabby" ``` @@ -1294,7 +1294,7 @@ first column of the data frame, again a *vector* of type *character*. cats["coat"] ``` -```{.output} +```output coat 1 calico 2 black @@ -1309,7 +1309,7 @@ the column name. Like example 1, the returned object is a *list*. cats[1, 1] ``` -```{.output} +```output [1] "calico" ``` @@ -1322,7 +1322,7 @@ is a *vector* of type *character*. cats[, 1] ``` -```{.output} +```output [1] "calico" "black" "tabby" ``` @@ -1335,7 +1335,7 @@ value as all the elements in this *column* and returns them as a *vector*. cats[1, ] ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 TRUE ``` @@ -1361,7 +1361,7 @@ Data frames have column names, which can be accessed with the `names()` function names(cats) ``` -```{.output} +```output [1] "coat" "weight" "likes_string" ``` @@ -1373,7 +1373,7 @@ names(cats)[2] <- "weight_kg" cats ``` -```{.output} +```output coat weight_kg likes_string 1 calico 2.1 TRUE 2 black 5.0 FALSE @@ -1394,7 +1394,7 @@ matrix_example <- matrix(0, ncol=6, nrow=3) matrix_example ``` -```{.output} +```output [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 @@ -1408,7 +1408,7 @@ What makes it special is the `dim()` attribute: dim(matrix_example) ``` -```{.output} +```output [1] 3 6 ``` @@ -1419,7 +1419,7 @@ And similar to other data structures, we can ask things about our matrix: typeof(matrix_example) ``` -```{.output} +```output [1] "double" ``` @@ -1427,7 +1427,7 @@ typeof(matrix_example) class(matrix_example) ``` -```{.output} +```output [1] "matrix" "array" ``` @@ -1435,7 +1435,7 @@ class(matrix_example) str(matrix_example) ``` -```{.output} +```output num [1:3, 1:6] 0 0 0 0 0 0 0 0 0 0 ... ``` @@ -1443,7 +1443,7 @@ str(matrix_example) nrow(matrix_example) ``` -```{.output} +```output [1] 3 ``` @@ -1451,7 +1451,7 @@ nrow(matrix_example) ncol(matrix_example) ``` -```{.output} +```output [1] 6 ``` @@ -1477,7 +1477,7 @@ matrix_example <- matrix(0, ncol=6, nrow=3) length(matrix_example) ``` -```{.output} +```output [1] 18 ``` @@ -1560,7 +1560,7 @@ to remind people of the importance of these basics. Consider the R output of the matrix below: -```{.output} +```output [,1] [,2] [1,] 4 1 [2,] 9 5 @@ -1583,7 +1583,7 @@ Think about what matrices the other commands will produce. Consider the R output of the matrix below: -```{.output} +```output [,1] [,2] [1,] 4 1 [2,] 9 5 diff --git a/05-data-structures-part2.md b/05-data-structures-part2.md index 04d1fc1b9..e56b7392f 100644 --- a/05-data-structures-part2.md +++ b/05-data-structures-part2.md @@ -40,7 +40,7 @@ age <- c(2, 3, 5) cats ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 1 2 black 5.0 0 @@ -54,7 +54,7 @@ We can then add this as a column via: cbind(cats, age) ``` -```{.output} +```output coat weight likes_string age 1 calico 2.1 1 2 2 black 5.0 0 3 @@ -69,7 +69,7 @@ age <- c(2, 3, 5, 12) cbind(cats, age) ``` -```{.error} +```error Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 3, 4 ``` @@ -78,7 +78,7 @@ age <- c(2, 3) cbind(cats, age) ``` -```{.error} +```error Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 3, 2 ``` @@ -90,7 +90,7 @@ for every row in the table: nrow(cats) ``` -```{.output} +```output [1] 3 ``` @@ -98,7 +98,7 @@ nrow(cats) length(age) ``` -```{.output} +```output [1] 2 ``` @@ -126,7 +126,7 @@ Let's confirm that our new row was added correctly. cats ``` -```{.output} +```output coat weight likes_string age 1 calico 2.1 1 2 2 black 5.0 0 3 @@ -144,7 +144,7 @@ We now know how to add rows and columns to our data frame in R. Now let's learn cats ``` -```{.output} +```output coat weight likes_string age 1 calico 2.1 1 2 2 black 5.0 0 3 @@ -159,7 +159,7 @@ We can ask for a data frame minus the last row: cats[-4, ] ``` -```{.output} +```output coat weight likes_string age 1 calico 2.1 1 2 2 black 5.0 0 3 @@ -181,7 +181,7 @@ We can also remove columns in our data frame. What if we want to remove the colu cats[,-4] ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 1 2 black 5.0 0 @@ -199,7 +199,7 @@ drop <- names(cats) %in% c("age") cats[,!drop] ``` -```{.output} +```output coat weight likes_string 1 calico 2.1 1 2 black 5.0 0 @@ -221,7 +221,7 @@ cats <- rbind(cats, cats) cats ``` -```{.output} +```output coat weight likes_string age 1 calico 2.1 1 2 2 black 5.0 0 3 @@ -321,7 +321,7 @@ out what the data looks like with `str`: str(gapminder) ``` -```{.output} +```output 'data.frame': 1704 obs. of 6 variables: $ country : chr "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ... $ year : int 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 ... @@ -338,7 +338,7 @@ An additional method for examining the structure of gapminder is to use the `sum summary(gapminder) ``` -```{.output} +```output country year pop continent Length:1704 Min. :1952 Min. :6.001e+04 Length:1704 Class :character 1st Qu.:1966 1st Qu.:2.794e+06 Class :character @@ -362,7 +362,7 @@ Along with the `str` and `summary` functions, we can examine individual columns typeof(gapminder$year) ``` -```{.output} +```output [1] "integer" ``` @@ -370,7 +370,7 @@ typeof(gapminder$year) typeof(gapminder$country) ``` -```{.output} +```output [1] "character" ``` @@ -378,7 +378,7 @@ typeof(gapminder$country) str(gapminder$country) ``` -```{.output} +```output chr [1:1704] "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ... ``` @@ -391,7 +391,7 @@ variables in gapminder, what do you think the following will produce, and why? length(gapminder) ``` -```{.output} +```output [1] 6 ``` @@ -404,7 +404,7 @@ is a *list of vectors and factors*: typeof(gapminder) ``` -```{.output} +```output [1] "list" ``` @@ -416,7 +416,7 @@ columns. To get the number of rows and columns in our dataset, try: nrow(gapminder) ``` -```{.output} +```output [1] 1704 ``` @@ -424,7 +424,7 @@ nrow(gapminder) ncol(gapminder) ``` -```{.output} +```output [1] 6 ``` @@ -435,7 +435,7 @@ Or, both at once: dim(gapminder) ``` -```{.output} +```output [1] 1704 6 ``` @@ -447,7 +447,7 @@ ask for them later: colnames(gapminder) ``` -```{.output} +```output [1] "country" "year" "pop" "continent" "lifeExp" "gdpPercap" ``` @@ -466,7 +466,7 @@ to start digging into our data proper. Check out the first few lines: head(gapminder) ``` -```{.output} +```output country year pop continent lifeExp gdpPercap 1 Afghanistan 1952 8425333 Asia 28.801 779.4453 2 Afghanistan 1957 9240934 Asia 30.332 820.8530 diff --git a/06-data-subsetting.md b/06-data-subsetting.md index f52de0833..a940a9bc1 100644 --- a/06-data-subsetting.md +++ b/06-data-subsetting.md @@ -36,7 +36,7 @@ names(x) <- c('a', 'b', 'c', 'd', 'e') x ``` -```{.output} +```output a b c d e 5.4 6.2 7.1 4.8 7.5 ``` @@ -63,7 +63,7 @@ from one: x[1] ``` -```{.output} +```output a 5.4 ``` @@ -73,7 +73,7 @@ x[1] x[4] ``` -```{.output} +```output d 4.8 ``` @@ -88,7 +88,7 @@ We can ask for multiple elements at once: x[c(1, 3)] ``` -```{.output} +```output a c 5.4 7.1 ``` @@ -100,7 +100,7 @@ Or slices of the vector: x[1:4] ``` -```{.output} +```output a b c d 5.4 6.2 7.1 4.8 ``` @@ -112,7 +112,7 @@ the `:` operator creates a sequence of numbers from the left element to the righ 1:4 ``` -```{.output} +```output [1] 1 2 3 4 ``` @@ -120,7 +120,7 @@ the `:` operator creates a sequence of numbers from the left element to the righ c(1, 2, 3, 4) ``` -```{.output} +```output [1] 1 2 3 4 ``` @@ -131,7 +131,7 @@ We can ask for the same element multiple times: x[c(1,1,3)] ``` -```{.output} +```output a a c 5.4 5.4 7.1 ``` @@ -143,7 +143,7 @@ If we ask for an index beyond the length of the vector, R will return a missing x[6] ``` -```{.output} +```output NA ``` @@ -157,7 +157,7 @@ If we ask for the 0th element, we get an empty vector: x[0] ``` -```{.output} +```output named numeric(0) ``` @@ -181,7 +181,7 @@ every element *except* for the one specified: x[-2] ``` -```{.output} +```output a c d e 5.4 7.1 4.8 7.5 ``` @@ -193,7 +193,7 @@ We can skip multiple elements: x[c(-1, -5)] # or x[-c(1,5)] ``` -```{.output} +```output b c d 6.2 7.1 4.8 ``` @@ -214,7 +214,7 @@ x[-1:3] This gives a somewhat cryptic error: -```{.error} +```error Error in x[-1:3]: only 0's may be mixed with negative subscripts ``` @@ -230,7 +230,7 @@ that the `-` operator applies to the result: x[-(1:3)] ``` -```{.output} +```output d e 4.8 7.5 ``` @@ -246,7 +246,7 @@ x <- x[-4] x ``` -```{.output} +```output a b c e 5.4 6.2 7.1 7.5 ``` @@ -264,7 +264,7 @@ names(x) <- c('a', 'b', 'c', 'd', 'e') print(x) ``` -```{.output} +```output a b c d e 5.4 6.2 7.1 4.8 7.5 ``` @@ -272,7 +272,7 @@ print(x) Come up with at least 2 different commands that will produce the following output: -```{.output} +```output b c d 6.2 7.1 4.8 ``` @@ -288,7 +288,7 @@ After you find 2 different commands, compare notes with your neighbour. Did you x[2:4] ``` -```{.output} +```output b c d 6.2 7.1 4.8 ``` @@ -298,7 +298,7 @@ x[2:4] x[-c(1,5)] ``` -```{.output} +```output b c d 6.2 7.1 4.8 ``` @@ -308,7 +308,7 @@ x[-c(1,5)] x[c(2,3,4)] ``` -```{.output} +```output b c d 6.2 7.1 4.8 ``` @@ -327,7 +327,7 @@ x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # we can name a vector 'on the fly' x[c("a", "c")] ``` -```{.output} +```output a c 5.4 7.1 ``` @@ -345,7 +345,7 @@ We can also use any logical vector to subset: x[c(FALSE, FALSE, TRUE, FALSE, TRUE)] ``` -```{.output} +```output c e 7.1 7.5 ``` @@ -359,7 +359,7 @@ the same result as the previous one. x[x > 7] ``` -```{.output} +```output c e 7.1 7.5 ``` @@ -376,7 +376,7 @@ We can use `==` to mimic the previous method of indexing by name x[names(x) == "a"] ``` -```{.output} +```output a 5.4 ``` @@ -427,7 +427,7 @@ names(x) <- c('a', 'b', 'c', 'd', 'e') print(x) ``` -```{.output} +```output a b c d e 5.4 6.2 7.1 4.8 7.5 ``` @@ -444,7 +444,7 @@ x_subset <- x[x<7 & x>4] print(x_subset) ``` -```{.output} +```output a b d 5.4 6.2 4.8 ``` @@ -468,7 +468,7 @@ x <- 1:3 x ``` -```{.output} +```output [1] 1 2 3 ``` @@ -477,7 +477,7 @@ names(x) <- c('a', 'a', 'a') x ``` -```{.output} +```output a a a 1 2 3 ``` @@ -486,7 +486,7 @@ a a a x['a'] # only returns first value ``` -```{.output} +```output a 1 ``` @@ -495,7 +495,7 @@ a x[names(x) == 'a'] # returns all three values ``` -```{.output} +```output a a a 1 2 3 ``` @@ -521,7 +521,7 @@ x <- c(a=5.4, b=6.2, c=7.1, d=4.8, e=7.5) # we start again by naming a vector 'o x[-"a"] ``` -```{.error} +```error Error in -"a": invalid argument to unary operator ``` @@ -532,7 +532,7 @@ However, we can use the `!=` (not-equals) operator to construct a logical vector x[names(x) != "a"] ``` -```{.output} +```output b c d e 6.2 7.1 4.8 7.5 ``` @@ -544,12 +544,12 @@ Skipping multiple named indices is a little bit harder still. Suppose we want to x[names(x)!=c("a","c")] ``` -```{.warning} +```warning Warning in names(x) != c("a", "c"): longer object length is not a multiple of shorter object length ``` -```{.output} +```output b c d e 6.2 7.1 4.8 7.5 ``` @@ -567,12 +567,12 @@ Let's take a look at the comparison component of this code: names(x) != c("a", "c") ``` -```{.warning} +```warning Warning in names(x) != c("a", "c"): longer object length is not a multiple of shorter object length ``` -```{.output} +```output [1] FALSE TRUE TRUE TRUE TRUE ``` @@ -598,7 +598,7 @@ The way to get R to do what we really want (match *each* element of the left arg x[! names(x) %in% c("a","c") ] ``` -```{.output} +```output b d e 6.2 4.8 7.5 ``` @@ -688,7 +688,7 @@ f <- factor(c("a", "a", "b", "c", "c", "d")) f[f == "a"] ``` -```{.output} +```output [1] a a Levels: a b c d ``` @@ -697,7 +697,7 @@ Levels: a b c d f[f %in% c("b", "c")] ``` -```{.output} +```output [1] b c c Levels: a b c d ``` @@ -706,7 +706,7 @@ Levels: a b c d f[1:3] ``` -```{.output} +```output [1] a a b Levels: a b c d ``` @@ -719,7 +719,7 @@ even if no more of that category exists in the factor: f[-3] ``` -```{.output} +```output [1] a a c c d Levels: a b c d ``` @@ -737,7 +737,7 @@ m <- matrix(rnorm(6*4), ncol=4, nrow=6) m[3:4, c(3,1)] ``` -```{.output} +```output [,1] [,2] [1,] 1.12493092 -0.8356286 [2,] -0.04493361 1.5952808 @@ -751,7 +751,7 @@ rows or columns respectively: m[, c(3,4)] ``` -```{.output} +```output [,1] [,2] [1,] -0.62124058 0.82122120 [2,] -2.21469989 0.59390132 @@ -769,7 +769,7 @@ to a vector: m[3,] ``` -```{.output} +```output [1] -0.8356286 0.5757814 1.1249309 0.9189774 ``` @@ -781,7 +781,7 @@ If you want to keep the output as a matrix, you need to specify a *third* argume m[3, , drop=FALSE] ``` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] -0.8356286 0.5757814 1.124931 0.9189774 ``` @@ -794,7 +794,7 @@ R will throw an error: m[, c(3,6)] ``` -```{.error} +```error Error in m[, c(3, 6)]: subscript out of bounds ``` @@ -816,7 +816,7 @@ also subset using only one argument: m[5] ``` -```{.output} +```output [1] 0.3295078 ``` @@ -829,7 +829,7 @@ vector are arranged column-wise: matrix(1:6, nrow=2, ncol=3) ``` -```{.output} +```output [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 @@ -842,7 +842,7 @@ If you wish to populate the matrix by row, use `byrow=TRUE`: matrix(1:6, nrow=2, ncol=3, byrow=TRUE) ``` -```{.output} +```output [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 5 6 @@ -863,7 +863,7 @@ m <- matrix(1:18, nrow=3, ncol=6) print(m) ``` -```{.output} +```output [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 4 7 10 13 16 [2,] 2 5 8 11 14 17 @@ -906,7 +906,7 @@ xlist <- list(a = "Software Carpentry", b = 1:10, data = head(mtcars)) xlist[1] ``` -```{.output} +```output $a [1] "Software Carpentry" ``` @@ -924,7 +924,7 @@ data structures. xlist[1:2] ``` -```{.output} +```output $a [1] "Software Carpentry" @@ -940,7 +940,7 @@ bracket function: `[[`. xlist[[1]] ``` -```{.output} +```output [1] "Software Carpentry" ``` @@ -953,7 +953,7 @@ You can't extract more than one element at once: xlist[[1:2]] ``` -```{.error} +```error Error in xlist[[1:2]]: subscript out of bounds ``` @@ -964,7 +964,7 @@ Nor use it to skip elements: xlist[[-1]] ``` -```{.error} +```error Error in xlist[[-1]]: invalid negative subscript in get1index ``` @@ -975,7 +975,7 @@ But you can use names to both subset and extract elements: xlist[["a"]] ``` -```{.output} +```output [1] "Software Carpentry" ``` @@ -986,7 +986,7 @@ The `$` function is a shorthand way for extracting elements by name: xlist$data ``` -```{.output} +```output mpg cyl disp hp drat wt qsec vs am gear carb Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 @@ -1019,7 +1019,7 @@ Hint: the number 2 is contained within the "b" item in the list. xlist$b[2] ``` -```{.output} +```output [1] 2 ``` @@ -1028,7 +1028,7 @@ xlist$b[2] xlist[[2]][2] ``` -```{.output} +```output [1] 2 ``` @@ -1037,7 +1037,7 @@ xlist[[2]][2] xlist[["b"]][2] ``` -```{.output} +```output [1] 2 ``` @@ -1089,7 +1089,7 @@ element corresponds to a column. The resulting object will be a data frame: head(gapminder[3]) ``` -```{.output} +```output pop 1 8425333 2 9240934 @@ -1106,7 +1106,7 @@ Similarly, `[[` will act to extract *a single column*: head(gapminder[["lifeExp"]]) ``` -```{.output} +```output [1] 28.801 30.332 31.997 34.020 36.088 38.438 ``` @@ -1117,7 +1117,7 @@ And `$` provides a convenient shorthand to extract columns by name: head(gapminder$year) ``` -```{.output} +```output [1] 1952 1957 1962 1967 1972 1977 ``` @@ -1128,7 +1128,7 @@ With two arguments, `[` behaves the same way as for matrices: gapminder[1:3,] ``` -```{.output} +```output country year pop continent lifeExp gdpPercap 1 Afghanistan 1952 8425333 Asia 28.801 779.4453 2 Afghanistan 1957 9240934 Asia 30.332 820.8530 @@ -1143,7 +1143,7 @@ the elements are mixed types): gapminder[3,] ``` -```{.output} +```output country year pop continent lifeExp gdpPercap 3 Afghanistan 1962 10267083 Asia 31.997 853.1007 ``` diff --git a/07-control-flow.md b/07-control-flow.md index aac41dfa4..355b96172 100644 --- a/07-control-flow.md +++ b/07-control-flow.md @@ -56,7 +56,7 @@ if (x >= 10) { x ``` -```{.output} +```output [1] 8 ``` @@ -73,7 +73,7 @@ if (x >= 10) { } ``` -```{.output} +```output [1] "x is less than 10" ``` @@ -92,7 +92,7 @@ if (x >= 10) { } ``` -```{.output} +```output [1] "x is greater than 5, but less than 10" ``` @@ -110,7 +110,7 @@ if (x) { } ``` -```{.output} +```output [1] "4 does not equal 3" ``` @@ -122,7 +122,7 @@ x <- 4 == 3 x ``` -```{.output} +```output [1] FALSE ``` @@ -186,7 +186,7 @@ if(any(gapminder$year == 2002)){ Did anyone get a warning message like this? -```{.error} +```error Error in if (gapminder$year == 2012) {: the condition has length > 1 ``` @@ -222,7 +222,7 @@ y <- -3 ifelse(y < 0, "y is a negative number", "y is either positive or zero") ``` -```{.output} +```output [1] "y is a negative number" ``` @@ -273,7 +273,7 @@ for (i in 1:10) { } ``` -```{.output} +```output [1] 1 [1] 2 [1] 3 @@ -301,7 +301,7 @@ for (i in 1:5) { } ``` -```{.output} +```output [1] "1 a" [1] "1 b" [1] "1 c" @@ -348,7 +348,7 @@ for (i in 1:5) { output_vector ``` -```{.output} +```output [1] "1 a" "1 b" "1 c" "1 d" "1 e" "2 a" "2 b" "2 c" "2 d" "2 e" "3 a" "3 b" [13] "3 c" "3 d" "3 e" "4 a" "4 b" "4 c" "4 d" "4 e" "5 a" "5 b" "5 c" "5 d" [25] "5 e" @@ -394,7 +394,7 @@ output_vector2 <- as.vector(output_matrix) output_vector2 ``` -```{.output} +```output [1] "1 a" "2 a" "3 a" "4 a" "5 a" "1 b" "2 b" "3 b" "4 b" "5 b" "1 c" "2 c" [13] "3 c" "4 c" "5 c" "1 d" "2 d" "3 d" "4 d" "5 d" "1 e" "2 e" "3 e" "4 e" [25] "5 e" diff --git a/08-plot-ggplot2.md b/08-plot-ggplot2.md index f278811e8..de0df23a0 100644 --- a/08-plot-ggplot2.md +++ b/08-plot-ggplot2.md @@ -315,7 +315,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) + geom_point(alpha = 0.5) + scale_x_log10() + geom_smooth(method="lm") ``` -```{.output} +```output `geom_smooth()` using formula = 'y ~ x' ``` @@ -330,7 +330,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) + geom_point(alpha = 0.5) + scale_x_log10() + geom_smooth(method="lm", size=1.5) ``` -```{.warning} +```warning Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. ℹ Please use `linewidth` instead. This warning is displayed once every 8 hours. @@ -338,7 +338,7 @@ Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. ``` -```{.output} +```output `geom_smooth()` using formula = 'y ~ x' ``` @@ -374,7 +374,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) + geom_smooth(method="lm", size=1.5) ``` -```{.output} +```output `geom_smooth()` using formula = 'y ~ x' ``` @@ -409,7 +409,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp, color = conti geom_smooth(method="lm", size=1.5) ``` -```{.output} +```output `geom_smooth()` using formula = 'y ~ x' ``` diff --git a/09-vectorization.md b/09-vectorization.md index 9e751ed08..528e0d02c 100644 --- a/09-vectorization.md +++ b/09-vectorization.md @@ -30,7 +30,7 @@ x <- 1:4 x * 2 ``` -```{.output} +```output [1] 2 4 6 8 ``` @@ -44,7 +44,7 @@ y <- 6:9 x + y ``` -```{.output} +```output [1] 7 9 11 13 ``` @@ -70,7 +70,7 @@ for (i in 1:4) { output_vector ``` -```{.output} +```output [1] 7 9 11 13 ``` @@ -82,7 +82,7 @@ sum_xy <- x + y sum_xy ``` -```{.output} +```output [1] 7 9 11 13 ``` @@ -114,7 +114,7 @@ gapminder$pop_millions <- gapminder$pop / 1e6 head(gapminder) ``` -```{.output} +```output country year pop continent lifeExp gdpPercap pop_millions 1 Afghanistan 1952 8425333 Asia 28.801 779.4453 8.425333 2 Afghanistan 1957 9240934 Asia 30.332 820.8530 9.240934 @@ -176,7 +176,7 @@ vectorized: x > 2 ``` -```{.output} +```output [1] FALSE FALSE TRUE TRUE ``` @@ -188,7 +188,7 @@ a <- x > 3 # or, for clarity, a <- (x > 3) a ``` -```{.output} +```output [1] FALSE FALSE FALSE TRUE ``` @@ -212,7 +212,7 @@ x <- 1:4 log(x) ``` -```{.output} +```output [1] 0.0000000 0.6931472 1.0986123 1.3862944 ``` @@ -224,7 +224,7 @@ m <- matrix(1:12, nrow=3, ncol=4) m * -1 ``` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] -1 -4 -7 -10 [2,] -2 -5 -8 -11 @@ -243,7 +243,7 @@ To do matrix multiplication, we need to use the `%*%` operator: m %*% matrix(1, nrow=4, ncol=1) ``` -```{.output} +```output [,1] [1,] 22 [2,] 26 @@ -254,7 +254,7 @@ m %*% matrix(1, nrow=4, ncol=1) matrix(1:4, nrow=1) %*% matrix(1:4, ncol=1) ``` -```{.output} +```output [,1] [1,] 30 ``` @@ -277,7 +277,7 @@ m <- matrix(1:12, nrow=3, ncol=4) m ``` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 2 5 8 11 @@ -305,7 +305,7 @@ m <- matrix(1:12, nrow=3, ncol=4) m ``` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 2 5 8 11 @@ -317,7 +317,7 @@ Write down what you think will happen when you run: 1. `m ^ -1` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] 1.0000000 0.2500000 0.1428571 0.10000000 [2,] 0.5000000 0.2000000 0.1250000 0.09090909 @@ -327,7 +327,7 @@ Write down what you think will happen when you run: 2. `m * c(1, 0, -1)` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 0 0 0 0 @@ -337,7 +337,7 @@ Write down what you think will happen when you run: 3. `m > c(0, 20)` -```{.output} +```output [,1] [,2] [,3] [,4] [1,] TRUE FALSE TRUE FALSE [2,] FALSE TRUE FALSE TRUE @@ -386,7 +386,7 @@ How about when n=10,000? sum(1/(1:100)^2) ``` -```{.output} +```output [1] 1.634984 ``` @@ -394,7 +394,7 @@ sum(1/(1:100)^2) sum(1/(1:1e04)^2) ``` -```{.output} +```output [1] 1.644834 ``` @@ -403,7 +403,7 @@ n <- 10000 sum(1/(1:n)^2) ``` -```{.output} +```output [1] 1.644834 ``` @@ -417,7 +417,7 @@ inverse_sum_of_squares <- function(n) { inverse_sum_of_squares(100) ``` -```{.output} +```output [1] 1.634984 ``` @@ -425,7 +425,7 @@ inverse_sum_of_squares(100) inverse_sum_of_squares(10000) ``` -```{.output} +```output [1] 1.644834 ``` @@ -434,7 +434,7 @@ n <- 10000 inverse_sum_of_squares(n) ``` -```{.output} +```output [1] 1.644834 ``` @@ -458,12 +458,12 @@ y <- c(1, 2, 3, 4, 5, 6, 7) x + y ``` -```{.warning} +```warning Warning in x + y: longer object length is not a multiple of shorter object length ``` -```{.output} +```output [1] 2 4 6 5 7 9 8 ``` diff --git a/10-functions.md b/10-functions.md index bf2bea211..d911ea3f3 100644 --- a/10-functions.md +++ b/10-functions.md @@ -114,7 +114,7 @@ Calling our own function is no different from calling any other function: fahr_to_kelvin(32) ``` -```{.output} +```output [1] 273.15 ``` @@ -124,7 +124,7 @@ fahr_to_kelvin(32) fahr_to_kelvin(212) ``` -```{.output} +```output [1] 373.15 ``` @@ -278,7 +278,7 @@ It still works when given proper input. fahr_to_kelvin(temp = 32) ``` -```{.output} +```output [1] 273.15 ``` @@ -290,7 +290,7 @@ But fails instantly if given improper input. fahr_to_kelvin(temp = as.factor(32)) ``` -```{.error} +```error Error in fahr_to_kelvin(temp = as.factor(32)): is.numeric(temp) is not TRUE ``` @@ -360,7 +360,7 @@ whatever command is executed on the last line of the function. calcGDP(head(gapminder)) ``` -```{.output} +```output [1] 6567086330 7585448670 8758855797 9648014150 9678553274 11697659231 ``` @@ -409,7 +409,7 @@ Let's take a look at what happens when we specify the year: head(calcGDP(gapminder, year=2007)) ``` -```{.output} +```output country year pop continent lifeExp gdpPercap gdp 12 Afghanistan 2007 31889923 Asia 43.828 974.5803 31079291949 24 Albania 2007 3600523 Europe 76.423 5937.0295 21376411360 @@ -426,7 +426,7 @@ Or for a specific country: calcGDP(gapminder, country="Australia") ``` -```{.output} +```output country year pop continent lifeExp gdpPercap gdp 61 Australia 1952 8691212 Oceania 69.120 10039.60 87256254102 62 Australia 1957 9712569 Oceania 70.330 10949.65 106349227169 @@ -449,7 +449,7 @@ Or both: calcGDP(gapminder, year=2007, country="Australia") ``` -```{.output} +```output country year pop continent lifeExp gdpPercap gdp 72 Australia 2007 20434176 Oceania 81.235 34435.37 703658358894 ``` @@ -572,7 +572,7 @@ best_practice <- c("Write", "programs", "for", "people", "not", "computers") paste(best_practice, collapse=" ") ``` -```{.output} +```output [1] "Write programs for people not computers" ``` @@ -607,7 +607,7 @@ best_practice <- c("Write", "programs", "for", "people", "not", "computers") fence(text=best_practice, wrapper="***") ``` -```{.output} +```output [1] "*** Write programs for people not computers ***" ``` diff --git a/11-writing-data.md b/11-writing-data.md index ea076a0b8..8ff3ff209 100644 --- a/11-writing-data.md +++ b/11-writing-data.md @@ -116,7 +116,7 @@ OK: head cleaned-data/gapminder-aus.csv ``` -```{.output} +```output "country","year","pop","continent","lifeExp","gdpPercap" "61","Australia",1952,8691212,"Oceania",69.12,10039.59564 "62","Australia",1957,9712569,"Oceania",70.33,10949.64959 @@ -163,7 +163,7 @@ Now lets look at the data again using our shell skills: head cleaned-data/gapminder-aus.csv ``` -```{.output} +```output country,year,pop,continent,lifeExp,gdpPercap Australia,1952,8691212,Oceania,69.12,10039.59564 Australia,1957,9712569,Oceania,70.33,10949.64959 diff --git a/12-dplyr.md b/12-dplyr.md index a332e936b..a6e39d500 100644 --- a/12-dplyr.md +++ b/12-dplyr.md @@ -31,7 +31,7 @@ do these operations using the normal base R operations: mean(gapminder$gdpPercap[gapminder$continent == "Africa"]) ``` -```{.output} +```output [1] 2193.755 ``` @@ -39,7 +39,7 @@ mean(gapminder$gdpPercap[gapminder$continent == "Africa"]) mean(gapminder$gdpPercap[gapminder$continent == "Americas"]) ``` -```{.output} +```output [1] 7136.11 ``` @@ -47,7 +47,7 @@ mean(gapminder$gdpPercap[gapminder$continent == "Americas"]) mean(gapminder$gdpPercap[gapminder$continent == "Asia"]) ``` -```{.output} +```output [1] 7902.15 ``` @@ -154,7 +154,7 @@ tidy_gdp <- year_country_gdp %>% rename(gdp_per_capita = gdpPercap) head(tidy_gdp) ``` -```{.output} +```output year country gdp_per_capita 1 1952 Afghanistan 779.4453 2 1957 Afghanistan 820.8530 @@ -232,7 +232,7 @@ could have used in filter. str(gapminder) ``` -```{.output} +```output 'data.frame': 1704 obs. of 6 variables: $ country : chr "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ... $ year : int 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 ... @@ -246,7 +246,7 @@ str(gapminder) str(gapminder %>% group_by(continent)) ``` -```{.output} +```output gropd_df [1,704 × 6] (S3: grouped_df/tbl_df/tbl/data.frame) $ country : chr [1:1704] "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ... $ year : int [1:1704] 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 ... @@ -326,7 +326,7 @@ lifeExp_bycountry %>% filter(mean_lifeExp == min(mean_lifeExp) | mean_lifeExp == max(mean_lifeExp)) ``` -```{.output} +```output # A tibble: 2 × 2 country mean_lifeExp @@ -347,7 +347,7 @@ lifeExp_bycountry %>% head(1) ``` -```{.output} +```output # A tibble: 1 × 2 country mean_lifeExp @@ -360,7 +360,7 @@ lifeExp_bycountry %>% head(1) ``` -```{.output} +```output # A tibble: 1 × 2 country mean_lifeExp @@ -376,7 +376,7 @@ lifeExp_bycountry %>% head(1) ``` -```{.output} +```output # A tibble: 1 × 2 country mean_lifeExp @@ -396,7 +396,7 @@ gdp_bycontinents_byyear <- gapminder %>% summarize(mean_gdpPercap = mean(gdpPercap)) ``` -```{.output} +```output `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument. ``` @@ -413,7 +413,7 @@ gdp_pop_bycontinents_byyear <- gapminder %>% sd_pop = sd(pop)) ``` -```{.output} +```output `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument. ``` @@ -435,7 +435,7 @@ gapminder %>% count(continent, sort = TRUE) ``` -```{.output} +```output continent n 1 Africa 52 2 Asia 33 @@ -454,7 +454,7 @@ gapminder %>% summarize(se_le = sd(lifeExp)/sqrt(n())) ``` -```{.output} +```output # A tibble: 5 × 2 continent se_le @@ -478,7 +478,7 @@ gapminder %>% se_le = sd(lifeExp)/sqrt(n())) ``` -```{.output} +```output # A tibble: 5 × 5 continent mean_le min_le max_le se_le @@ -506,7 +506,7 @@ gdp_pop_bycontinents_byyear <- gapminder %>% sd_gdp_billion = sd(gdp_billion)) ``` -```{.output} +```output `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument. ``` @@ -533,7 +533,7 @@ gdp_pop_bycontinents_byyear_above25 <- gapminder %>% sd_gdp_billion = sd(gdp_billion)) ``` -```{.output} +```output `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument. ``` @@ -548,7 +548,7 @@ gdp_future_bycontinents_byyear_high_lifeExp <- gapminder %>% mean_gdpPercap_expected = mean(gdp_futureExpectation)) ``` -```{.output} +```output `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument. ``` diff --git a/13-tidyr.md b/13-tidyr.md index 840c1a31b..e8debdc6c 100644 --- a/13-tidyr.md +++ b/13-tidyr.md @@ -68,7 +68,7 @@ First, lets look at the structure of our original gapminder data frame: str(gapminder) ``` -```{.output} +```output 'data.frame': 1704 obs. of 6 variables: $ country : chr "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ... $ year : int 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 ... @@ -133,7 +133,7 @@ gap_wide <- read.csv("data/gapminder_wide.csv", stringsAsFactors = FALSE) str(gap_wide) ``` -```{.output} +```output 'data.frame': 142 obs. of 38 variables: $ continent : chr "Africa" "Africa" "Africa" "Africa" ... $ country : chr "Algeria" "Angola" "Benin" "Botswana" ... @@ -191,7 +191,7 @@ gap_long <- gap_wide %>% str(gap_long) ``` -```{.output} +```output tibble [5,112 × 4] (S3: tbl_df/tbl/data.frame) $ continent : chr [1:5112] "Africa" "Africa" "Africa" "Africa" ... $ country : chr [1:5112] "Algeria" "Algeria" "Algeria" "Algeria" ... @@ -227,7 +227,7 @@ gap_long <- gap_wide %>% str(gap_long) ``` -```{.output} +```output tibble [5,112 × 4] (S3: tbl_df/tbl/data.frame) $ continent : chr [1:5112] "Africa" "Africa" "Africa" "Africa" ... $ country : chr [1:5112] "Algeria" "Algeria" "Algeria" "Algeria" ... @@ -266,12 +266,12 @@ gap_long %>% group_by(continent, obs_type) %>% summarize(means=mean(obs_values)) ``` -```{.output} +```output `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument. ``` -```{.output} +```output # A tibble: 15 × 3 # Groups: continent [5] continent obs_type means @@ -314,7 +314,7 @@ gap_normal <- gap_long %>% dim(gap_normal) ``` -```{.output} +```output [1] 1704 6 ``` @@ -322,7 +322,7 @@ dim(gap_normal) dim(gapminder) ``` -```{.output} +```output [1] 1704 6 ``` @@ -330,7 +330,7 @@ dim(gapminder) names(gap_normal) ``` -```{.output} +```output [1] "continent" "country" "year" "gdpPercap" "lifeExp" "pop" ``` @@ -338,7 +338,7 @@ names(gap_normal) names(gapminder) ``` -```{.output} +```output [1] "country" "year" "pop" "continent" "lifeExp" "gdpPercap" ``` @@ -352,7 +352,7 @@ gap_normal <- gap_normal[, names(gapminder)] all.equal(gap_normal, gapminder) ``` -```{.output} +```output [1] "Attributes: < Component \"class\": Lengths (3, 1) differ (string compare on first 1) >" [2] "Attributes: < Component \"class\": 1 string mismatch >" [3] "Component \"country\": 1704 string mismatches" @@ -366,7 +366,7 @@ all.equal(gap_normal, gapminder) head(gap_normal) ``` -```{.output} +```output # A tibble: 6 × 6 country year pop continent lifeExp gdpPercap @@ -382,7 +382,7 @@ head(gap_normal) head(gapminder) ``` -```{.output} +```output country year pop continent lifeExp gdpPercap 1 Afghanistan 1952 8425333 Asia 28.801 779.4453 2 Afghanistan 1957 9240934 Asia 30.332 820.8530 @@ -401,7 +401,7 @@ gap_normal <- gap_normal %>% arrange(country, year) all.equal(gap_normal, gapminder) ``` -```{.output} +```output [1] "Attributes: < Component \"class\": Lengths (3, 1) differ (string compare on first 1) >" [2] "Attributes: < Component \"class\": 1 string mismatch >" ``` @@ -422,7 +422,7 @@ gap_temp <- gap_long %>% unite(var_ID, continent, country, sep = "_") str(gap_temp) ``` -```{.output} +```output tibble [5,112 × 4] (S3: tbl_df/tbl/data.frame) $ var_ID : chr [1:5112] "Africa_Algeria" "Africa_Algeria" "Africa_Algeria" "Africa_Algeria" ... $ obs_type : chr [1:5112] "gdpPercap" "gdpPercap" "gdpPercap" "gdpPercap" ... @@ -437,7 +437,7 @@ gap_temp <- gap_long %>% str(gap_temp) ``` -```{.output} +```output tibble [5,112 × 3] (S3: tbl_df/tbl/data.frame) $ ID_var : chr [1:5112] "Africa_Algeria" "Africa_Algeria" "Africa_Algeria" "Africa_Algeria" ... $ var_names : chr [1:5112] "gdpPercap_1952" "gdpPercap_1957" "gdpPercap_1962" "gdpPercap_1967" ... @@ -457,7 +457,7 @@ gap_wide_new <- gap_long %>% str(gap_wide_new) ``` -```{.output} +```output tibble [142 × 37] (S3: tbl_df/tbl/data.frame) $ ID_var : chr [1:142] "Africa_Algeria" "Africa_Angola" "Africa_Benin" "Africa_Botswana" ... $ gdpPercap_1952: num [1:142] 2449 3521 1063 851 543 ... @@ -534,7 +534,7 @@ gap_wide_betterID <- gap_long %>% str(gap_wide_betterID) ``` -```{.output} +```output tibble [142 × 38] (S3: tbl_df/tbl/data.frame) $ continent : chr [1:142] "Africa" "Africa" "Africa" "Africa" ... $ country : chr [1:142] "Algeria" "Angola" "Benin" "Botswana" ... @@ -580,7 +580,7 @@ tibble [142 × 38] (S3: tbl_df/tbl/data.frame) all.equal(gap_wide, gap_wide_betterID) ``` -```{.output} +```output [1] "Attributes: < Component \"class\": Lengths (1, 3) differ (string compare on first 1) >" [2] "Attributes: < Component \"class\": 1 string mismatch >" ``` diff --git a/config.yaml b/config.yaml deleted file mode 100644 index e94fdac68..000000000 --- a/config.yaml +++ /dev/null @@ -1,95 +0,0 @@ -#------------------------------------------------------------ -# Values for this lesson. -#------------------------------------------------------------ - -# Which carpentry is this (swc, dc, lc, or cp)? -# swc: Software Carpentry -# dc: Data Carpentry -# lc: Library Carpentry -# cp: Carpentries (to use for instructor training for instance) -# incubator: The Carpentries Incubator -carpentry: 'swc' - -# Overall title for pages. -title: 'R for Reproducible Scientific Analysis' - -# Date the lesson was created (YYYY-MM-DD, this is empty by default) -created: '2015-04-18' - -# Comma-separated list of keywords for the lesson -keywords: 'software, data, lesson, The Carpentries' - -# Life cycle stage of the lesson -# possible values: pre-alpha, alpha, beta, stable -life_cycle: 'stable' - -# License of the lesson materials (recommended CC-BY 4.0) -license: 'CC-BY 4.0' - -# Link to the source repository for this lesson -source: 'https://github.com/swcarpentry/r-novice-gapminder' - -# Default branch of your lesson -branch: 'main' - -# Who to contact if there are any issues -contact: 'team@carpentries.org' - -# Navigation ------------------------------------------------ -# -# Use the following menu items to specify the order of -# individual pages in each dropdown section. Leave blank to -# include all pages in the folder. -# -# Example ------------- -# -# episodes: -# - introduction.md -# - first-steps.md -# -# learners: -# - setup.md -# -# instructors: -# - instructor-notes.md -# -# profiles: -# - one-learner.md -# - another-learner.md - -# Order of episodes in your lesson -episodes: -- 01-rstudio-intro.Rmd -- 02-project-intro.Rmd -- 03-seeking-help.Rmd -- 04-data-structures-part1.Rmd -- 05-data-structures-part2.Rmd -- 06-data-subsetting.Rmd -- 07-control-flow.Rmd -- 08-plot-ggplot2.Rmd -- 09-vectorization.Rmd -- 10-functions.Rmd -- 11-writing-data.Rmd -- 12-dplyr.Rmd -- 13-tidyr.Rmd -- 14-knitr-markdown.Rmd -- 15-wrap-up.Rmd - -# Information for Learners -learners: - -# Information for Instructors -instructors: - -# Learner Profiles -profiles: - -# Customisation --------------------------------------------- -# -# This space below is where custom yaml items (e.g. pinning -# sandpaper and varnish versions) should live - - -url: 'https://swcarpentry.github.io/r-novice-gapminder' -analytics: carpentries -lang: en diff --git a/fig/06-rmd-generate-figures.sh b/fig/06-rmd-generate-figures.sh old mode 100755 new mode 100644 diff --git a/fig/12-plyr-generate-figures.sh b/fig/12-plyr-generate-figures.sh old mode 100755 new mode 100644 diff --git a/md5sum.txt b/md5sum.txt index 7729d2096..5d03a125a 100644 --- a/md5sum.txt +++ b/md5sum.txt @@ -1,26 +1,26 @@ "file" "checksum" "built" "date" -"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2024-04-12" -"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2024-04-12" -"config.yaml" "8b9d63dd3c46d5b4d5fa4219b51a0dfc" "site/built/config.yaml" "2024-04-12" -"index.md" "86c8fb559b13d1695d55b52dd6cbf574" "site/built/index.md" "2024-04-12" -"episodes/01-rstudio-intro.Rmd" "04f6b758558750cef962768d78dd63b0" "site/built/01-rstudio-intro.md" "2024-04-16" -"episodes/02-project-intro.Rmd" "cd60cc3116d4f6be92f03f5cc51bcc3b" "site/built/02-project-intro.md" "2024-04-12" -"episodes/03-seeking-help.Rmd" "d24c310b8f36930e70379458f3c93461" "site/built/03-seeking-help.md" "2024-04-12" -"episodes/04-data-structures-part1.Rmd" "5ec938f71a9cec633cef9329d214c3a0" "site/built/04-data-structures-part1.md" "2024-04-12" -"episodes/05-data-structures-part2.Rmd" "95c5dd30b8288090ce89ecbf2d3072bd" "site/built/05-data-structures-part2.md" "2024-04-12" -"episodes/06-data-subsetting.Rmd" "5d4ce8731ab37ddea81874d63ae1ce86" "site/built/06-data-subsetting.md" "2024-04-12" -"episodes/07-control-flow.Rmd" "6a8691c8668737e4202f49b52aeb8ac6" "site/built/07-control-flow.md" "2024-04-12" -"episodes/08-plot-ggplot2.Rmd" "a9a97a1eee46dc82b83c6c740a4412cf" "site/built/08-plot-ggplot2.md" "2024-04-12" -"episodes/09-vectorization.Rmd" "e229eb061b3f072a132c4b31bbc2fdb0" "site/built/09-vectorization.md" "2024-04-12" -"episodes/10-functions.Rmd" "14edd4cf50edb8fefeb987a17d740e1a" "site/built/10-functions.md" "2024-04-12" -"episodes/11-writing-data.Rmd" "8b26e062dddd2394d00c6847ff0b7505" "site/built/11-writing-data.md" "2024-04-12" -"episodes/12-dplyr.Rmd" "fc20e35f891f0bb624647d69816c3220" "site/built/12-dplyr.md" "2024-04-12" -"episodes/13-tidyr.Rmd" "1c59c3bea4cec5e0c47654a546294f07" "site/built/13-tidyr.md" "2024-04-12" -"episodes/14-knitr-markdown.Rmd" "0c63ce92263a32f19fbec9f7b619b682" "site/built/14-knitr-markdown.md" "2024-04-12" -"episodes/15-wrap-up.Rmd" "c5ce0d34a37b7a99624ad1d6ac482256" "site/built/15-wrap-up.md" "2024-04-12" -"instructors/instructor-notes.md" "e61e7587564a6c4c11dbb6beea127764" "site/built/instructor-notes.md" "2024-04-12" -"learners/discuss.md" "42ad66ab1907e030914dbb2a94376a47" "site/built/discuss.md" "2024-04-12" -"learners/reference.md" "1cd851cc85adc26ea172da91e8c564f7" "site/built/reference.md" "2024-04-12" -"learners/setup.md" "f888f8a54b071715c0cf56896e650c00" "site/built/setup.md" "2024-04-12" -"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2024-04-12" -"renv/profiles/lesson-requirements/renv.lock" "c5c7ba2c4747ed796cf48687124c6f9e" "site/built/renv.lock" "2024-04-12" +"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2024-05-07" +"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2024-05-07" +"config.yaml" "8b9d63dd3c46d5b4d5fa4219b51a0dfc" "site/built/config.yaml" "2024-05-07" +"index.md" "86c8fb559b13d1695d55b52dd6cbf574" "site/built/index.md" "2024-05-07" +"episodes/01-rstudio-intro.Rmd" "04f6b758558750cef962768d78dd63b0" "site/built/01-rstudio-intro.md" "2024-05-07" +"episodes/02-project-intro.Rmd" "cd60cc3116d4f6be92f03f5cc51bcc3b" "site/built/02-project-intro.md" "2024-05-07" +"episodes/03-seeking-help.Rmd" "d24c310b8f36930e70379458f3c93461" "site/built/03-seeking-help.md" "2024-05-07" +"episodes/04-data-structures-part1.Rmd" "5ec938f71a9cec633cef9329d214c3a0" "site/built/04-data-structures-part1.md" "2024-05-07" +"episodes/05-data-structures-part2.Rmd" "95c5dd30b8288090ce89ecbf2d3072bd" "site/built/05-data-structures-part2.md" "2024-05-07" +"episodes/06-data-subsetting.Rmd" "5d4ce8731ab37ddea81874d63ae1ce86" "site/built/06-data-subsetting.md" "2024-05-07" +"episodes/07-control-flow.Rmd" "6a8691c8668737e4202f49b52aeb8ac6" "site/built/07-control-flow.md" "2024-05-07" +"episodes/08-plot-ggplot2.Rmd" "a9a97a1eee46dc82b83c6c740a4412cf" "site/built/08-plot-ggplot2.md" "2024-05-07" +"episodes/09-vectorization.Rmd" "e229eb061b3f072a132c4b31bbc2fdb0" "site/built/09-vectorization.md" "2024-05-07" +"episodes/10-functions.Rmd" "14edd4cf50edb8fefeb987a17d740e1a" "site/built/10-functions.md" "2024-05-07" +"episodes/11-writing-data.Rmd" "8b26e062dddd2394d00c6847ff0b7505" "site/built/11-writing-data.md" "2024-05-07" +"episodes/12-dplyr.Rmd" "fc20e35f891f0bb624647d69816c3220" "site/built/12-dplyr.md" "2024-05-07" +"episodes/13-tidyr.Rmd" "1c59c3bea4cec5e0c47654a546294f07" "site/built/13-tidyr.md" "2024-05-07" +"episodes/14-knitr-markdown.Rmd" "0c63ce92263a32f19fbec9f7b619b682" "site/built/14-knitr-markdown.md" "2024-05-07" +"episodes/15-wrap-up.Rmd" "c5ce0d34a37b7a99624ad1d6ac482256" "site/built/15-wrap-up.md" "2024-05-07" +"instructors/instructor-notes.md" "e61e7587564a6c4c11dbb6beea127764" "site/built/instructor-notes.md" "2024-05-07" +"learners/discuss.md" "42ad66ab1907e030914dbb2a94376a47" "site/built/discuss.md" "2024-05-07" +"learners/reference.md" "1cd851cc85adc26ea172da91e8c564f7" "site/built/reference.md" "2024-05-07" +"learners/setup.md" "f888f8a54b071715c0cf56896e650c00" "site/built/setup.md" "2024-05-07" +"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2024-05-07" +"renv/profiles/lesson-requirements/renv.lock" "a1ea73c0f46232383431e5531d0bb733" "site/built/renv.lock" "2024-05-07" diff --git a/renv.lock b/renv.lock deleted file mode 100644 index 53c910915..000000000 --- a/renv.lock +++ /dev/null @@ -1,1021 +0,0 @@ -{ - "R": { - "Version": "4.3.3", - "Repositories": [ - { - "Name": "carpentries", - "URL": "https://carpentries.r-universe.dev" - }, - { - "Name": "carpentries_archive", - "URL": "https://carpentries.github.io/drat" - }, - { - "Name": "CRAN", - "URL": "https://cran.rstudio.com" - } - ] - }, - "Packages": { - "DiagrammeR": { - "Package": "DiagrammeR", - "Version": "1.0.11", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "RColorBrewer", - "cli", - "dplyr", - "glue", - "htmltools", - "htmlwidgets", - "igraph", - "magrittr", - "purrr", - "readr", - "rlang", - "rstudioapi", - "scales", - "stringr", - "tibble", - "tidyr", - "viridisLite", - "visNetwork" - ], - "Hash": "584c1e1cbb6f9b6c3b0f4ef0ad960966" - }, - "MASS": { - "Package": "MASS", - "Version": "7.3-60.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "methods", - "stats", - "utils" - ], - "Hash": "b765b28387acc8ec9e9c1530713cb19c" - }, - "Matrix": { - "Package": "Matrix", - "Version": "1.6-5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "grid", - "lattice", - "methods", - "stats", - "utils" - ], - "Hash": "8c7115cd3a0e048bda2a7cd110549f7a" - }, - "R6": { - "Package": "R6", - "Version": "2.5.1", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R" - ], - "Hash": "470851b6d5d0ac559e9d01bb352b4021" - }, - "RColorBrewer": { - "Package": "RColorBrewer", - "Version": "1.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "45f0398006e83a5b10b72a90663d8d8c" - }, - "base64enc": { - "Package": "base64enc", - "Version": "0.1-3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R" - ], - "Hash": "543776ae6848fde2f48ff3816d0628bc" - }, - "bit": { - "Package": "bit", - "Version": "4.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "d242abec29412ce988848d0294b208fd" - }, - "bit64": { - "Package": "bit64", - "Version": "4.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "bit", - "methods", - "stats", - "utils" - ], - "Hash": "9fe98599ca456d6552421db0d6772d8f" - }, - "bslib": { - "Package": "bslib", - "Version": "0.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "base64enc", - "cachem", - "fastmap", - "grDevices", - "htmltools", - "jquerylib", - "jsonlite", - "lifecycle", - "memoise", - "mime", - "rlang", - "sass" - ], - "Hash": "8644cc53f43828f19133548195d7e59e" - }, - "cachem": { - "Package": "cachem", - "Version": "1.0.8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "fastmap", - "rlang" - ], - "Hash": "c35768291560ce302c0a6589f92e837d" - }, - "cli": { - "Package": "cli", - "Version": "3.6.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" - }, - "clipr": { - "Package": "clipr", - "Version": "0.8.0", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "utils" - ], - "Hash": "3f038e5ac7f41d4ac41ce658c85e3042" - }, - "colorspace": { - "Package": "colorspace", - "Version": "2.1-0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "methods", - "stats" - ], - "Hash": "f20c47fd52fae58b4e377c37bb8c335b" - }, - "cpp11": { - "Package": "cpp11", - "Version": "0.4.7", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "5a295d7d963cc5035284dcdbaf334f4e" - }, - "crayon": { - "Package": "crayon", - "Version": "1.5.2", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "grDevices", - "methods", - "utils" - ], - "Hash": "e8a1e41acf02548751f45c718d55aa6a" - }, - "digest": { - "Package": "digest", - "Version": "0.6.35", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "698ece7ba5a4fa4559e3d537e7ec3d31" - }, - "dplyr": { - "Package": "dplyr", - "Version": "1.1.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "cli", - "generics", - "glue", - "lifecycle", - "magrittr", - "methods", - "pillar", - "rlang", - "tibble", - "tidyselect", - "utils", - "vctrs" - ], - "Hash": "fedd9d00c2944ff00a0e2696ccf048ec" - }, - "evaluate": { - "Package": "evaluate", - "Version": "0.23", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods" - ], - "Hash": "daf4a1246be12c1fa8c7705a0935c1a0" - }, - "fansi": { - "Package": "fansi", - "Version": "1.0.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "utils" - ], - "Hash": "962174cf2aeb5b9eea581522286a911f" - }, - "farver": { - "Package": "farver", - "Version": "2.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8106d78941f34855c440ddb946b8f7a5" - }, - "fastmap": { - "Package": "fastmap", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f7736a18de97dea803bde0a2daaafb27" - }, - "fontawesome": { - "Package": "fontawesome", - "Version": "0.5.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "htmltools", - "rlang" - ], - "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" - }, - "fs": { - "Package": "fs", - "Version": "1.6.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods" - ], - "Hash": "47b5f30c720c23999b913a1a635cf0bb" - }, - "generics": { - "Package": "generics", - "Version": "0.1.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "methods" - ], - "Hash": "15e9634c0fcd294799e9b2e929ed1b86" - }, - "ggplot2": { - "Package": "ggplot2", - "Version": "3.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "MASS", - "R", - "cli", - "glue", - "grDevices", - "grid", - "gtable", - "isoband", - "lifecycle", - "mgcv", - "rlang", - "scales", - "stats", - "tibble", - "vctrs", - "withr" - ], - "Hash": "52ef83f93f74833007f193b2d4c159a2" - }, - "glue": { - "Package": "glue", - "Version": "1.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods" - ], - "Hash": "e0b3a53876554bd45879e596cdb10a52" - }, - "gtable": { - "Package": "gtable", - "Version": "0.3.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "grid", - "lifecycle", - "rlang" - ], - "Hash": "b29cf3031f49b04ab9c852c912547eef" - }, - "highr": { - "Package": "highr", - "Version": "0.10", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "xfun" - ], - "Hash": "06230136b2d2b9ba5805e1963fa6e890" - }, - "hms": { - "Package": "hms", - "Version": "1.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "lifecycle", - "methods", - "pkgconfig", - "rlang", - "vctrs" - ], - "Hash": "b59377caa7ed00fa41808342002138f9" - }, - "htmltools": { - "Package": "htmltools", - "Version": "0.5.8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "base64enc", - "digest", - "fastmap", - "grDevices", - "rlang", - "utils" - ], - "Hash": "149431ee39aba5bdc264112c8ff94444" - }, - "htmlwidgets": { - "Package": "htmlwidgets", - "Version": "1.6.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "htmltools", - "jsonlite", - "knitr", - "rmarkdown", - "yaml" - ], - "Hash": "04291cc45198225444a397606810ac37" - }, - "igraph": { - "Package": "igraph", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "cli", - "cpp11", - "grDevices", - "graphics", - "lifecycle", - "magrittr", - "methods", - "pkgconfig", - "rlang", - "stats", - "utils", - "vctrs" - ], - "Hash": "c3b7d801d722e26e4cd888e042bf9af5" - }, - "isoband": { - "Package": "isoband", - "Version": "0.2.7", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grid", - "utils" - ], - "Hash": "0080607b4a1a7b28979aecef976d8bc2" - }, - "jquerylib": { - "Package": "jquerylib", - "Version": "0.1.4", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "htmltools" - ], - "Hash": "5aab57a3bd297eee1c1d862735972182" - }, - "jsonlite": { - "Package": "jsonlite", - "Version": "1.8.8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "methods" - ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" - }, - "knitr": { - "Package": "knitr", - "Version": "1.45", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "evaluate", - "highr", - "methods", - "tools", - "xfun", - "yaml" - ], - "Hash": "1ec462871063897135c1bcbe0fc8f07d" - }, - "labeling": { - "Package": "labeling", - "Version": "0.4.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "graphics", - "stats" - ], - "Hash": "b64ec208ac5bc1852b285f665d6368b3" - }, - "lattice": { - "Package": "lattice", - "Version": "0.22-6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "grid", - "stats", - "utils" - ], - "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" - }, - "lifecycle": { - "Package": "lifecycle", - "Version": "1.0.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "rlang" - ], - "Hash": "b8552d117e1b808b09a832f589b79035" - }, - "magrittr": { - "Package": "magrittr", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R" - ], - "Hash": "7ce2733a9826b3aeb1775d56fd305472" - }, - "memoise": { - "Package": "memoise", - "Version": "2.0.1", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "cachem", - "rlang" - ], - "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" - }, - "mgcv": { - "Package": "mgcv", - "Version": "1.9-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "graphics", - "methods", - "nlme", - "splines", - "stats", - "utils" - ], - "Hash": "110ee9d83b496279960e162ac97764ce" - }, - "mime": { - "Package": "mime", - "Version": "0.12", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "tools" - ], - "Hash": "18e9c28c1d3ca1560ce30658b22ce104" - }, - "munsell": { - "Package": "munsell", - "Version": "0.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "colorspace", - "methods" - ], - "Hash": "6dfe8bf774944bd5595785e3229d8771" - }, - "nlme": { - "Package": "nlme", - "Version": "3.1-164", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "graphics", - "lattice", - "stats", - "utils" - ], - "Hash": "a623a2239e642806158bc4dc3f51565d" - }, - "pillar": { - "Package": "pillar", - "Version": "1.9.0", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "cli", - "fansi", - "glue", - "lifecycle", - "rlang", - "utf8", - "utils", - "vctrs" - ], - "Hash": "15da5a8412f317beeee6175fbc76f4bb" - }, - "pkgconfig": { - "Package": "pkgconfig", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "utils" - ], - "Hash": "01f28d4278f15c76cddbea05899c5d6f" - }, - "prettyunits": { - "Package": "prettyunits", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "6b01fc98b1e86c4f705ce9dcfd2f57c7" - }, - "progress": { - "Package": "progress", - "Version": "1.2.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "crayon", - "hms", - "prettyunits" - ], - "Hash": "f4625e061cb2865f111b47ff163a5ca6" - }, - "purrr": { - "Package": "purrr", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "lifecycle", - "magrittr", - "rlang", - "vctrs" - ], - "Hash": "1cba04a4e9414bdefc9dcaa99649a8dc" - }, - "rappdirs": { - "Package": "rappdirs", - "Version": "0.3.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R" - ], - "Hash": "5e3c5dc0b071b21fa128676560dbe94d" - }, - "readr": { - "Package": "readr", - "Version": "2.1.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "cli", - "clipr", - "cpp11", - "crayon", - "hms", - "lifecycle", - "methods", - "rlang", - "tibble", - "tzdb", - "utils", - "vroom" - ], - "Hash": "9de96463d2117f6ac49980577939dfb3" - }, - "renv": { - "Package": "renv", - "Version": "1.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "utils" - ], - "Hash": "32c3f93e8360f667ca5863272ec8ba6a" - }, - "rlang": { - "Package": "rlang", - "Version": "1.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" - }, - "rmarkdown": { - "Package": "rmarkdown", - "Version": "2.26", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "bslib", - "evaluate", - "fontawesome", - "htmltools", - "jquerylib", - "jsonlite", - "knitr", - "methods", - "tinytex", - "tools", - "utils", - "xfun", - "yaml" - ], - "Hash": "9b148e7f95d33aac01f31282d49e4f44" - }, - "rstudioapi": { - "Package": "rstudioapi", - "Version": "0.16.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "96710351d642b70e8f02ddeb237c46a7" - }, - "sass": { - "Package": "sass", - "Version": "0.4.9", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R6", - "fs", - "htmltools", - "rappdirs", - "rlang" - ], - "Hash": "d53dbfddf695303ea4ad66f86e99b95d" - }, - "scales": { - "Package": "scales", - "Version": "1.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "RColorBrewer", - "cli", - "farver", - "glue", - "labeling", - "lifecycle", - "munsell", - "rlang", - "viridisLite" - ], - "Hash": "c19df082ba346b0ffa6f833e92de34d1" - }, - "stringi": { - "Package": "stringi", - "Version": "1.8.3", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "stats", - "tools", - "utils" - ], - "Hash": "058aebddea264f4c99401515182e656a" - }, - "stringr": { - "Package": "stringr", - "Version": "1.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "lifecycle", - "magrittr", - "rlang", - "stringi", - "vctrs" - ], - "Hash": "960e2ae9e09656611e0b8214ad543207" - }, - "tibble": { - "Package": "tibble", - "Version": "3.2.1", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "fansi", - "lifecycle", - "magrittr", - "methods", - "pillar", - "pkgconfig", - "rlang", - "utils", - "vctrs" - ], - "Hash": "a84e2cc86d07289b3b6f5069df7a004c" - }, - "tidyr": { - "Package": "tidyr", - "Version": "1.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "cpp11", - "dplyr", - "glue", - "lifecycle", - "magrittr", - "purrr", - "rlang", - "stringr", - "tibble", - "tidyselect", - "utils", - "vctrs" - ], - "Hash": "915fb7ce036c22a6a33b5a8adb712eb1" - }, - "tidyselect": { - "Package": "tidyselect", - "Version": "1.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "lifecycle", - "rlang", - "vctrs", - "withr" - ], - "Hash": "829f27b9c4919c16b593794a6344d6c0" - }, - "tinytex": { - "Package": "tinytex", - "Version": "0.50", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "xfun" - ], - "Hash": "be7a76845222ad20adb761f462eed3ea" - }, - "tzdb": { - "Package": "tzdb", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "RSPM", - "Requirements": [ - "R", - "cpp11" - ], - "Hash": "f561504ec2897f4d46f0c7657e488ae1" - }, - "utf8": { - "Package": "utf8", - "Version": "1.2.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "62b65c52671e6665f803ff02954446e9" - }, - "vctrs": { - "Package": "vctrs", - "Version": "0.6.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "lifecycle", - "rlang" - ], - "Hash": "c03fa420630029418f7e6da3667aac4a" - }, - "viridisLite": { - "Package": "viridisLite", - "Version": "0.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "c826c7c4241b6fc89ff55aaea3fa7491" - }, - "visNetwork": { - "Package": "visNetwork", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "htmltools", - "htmlwidgets", - "jsonlite", - "magrittr", - "methods", - "stats", - "utils" - ], - "Hash": "3e48b097e8d9a91ecced2ed4817a678d" - }, - "vroom": { - "Package": "vroom", - "Version": "1.6.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "bit64", - "cli", - "cpp11", - "crayon", - "glue", - "hms", - "lifecycle", - "methods", - "progress", - "rlang", - "stats", - "tibble", - "tidyselect", - "tzdb", - "vctrs", - "withr" - ], - "Hash": "390f9315bc0025be03012054103d227c" - }, - "withr": { - "Package": "withr", - "Version": "3.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics" - ], - "Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35" - }, - "xfun": { - "Package": "xfun", - "Version": "0.43", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "stats", - "tools" - ], - "Hash": "ab6371d8653ce5f2f9290f4ec7b42a8e" - }, - "yaml": { - "Package": "yaml", - "Version": "2.3.8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "29240487a071f535f5e5d5a323b7afbd" - } - } -}