From 90899c451e0834765f4a2ff091e1dc236e335efb Mon Sep 17 00:00:00 2001 From: Eric Salomaki Date: Thu, 18 May 2023 15:56:39 -0400 Subject: [PATCH 1/3] Updated through Factors --- R_Bootcamp_Intro_R.ipynb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/R_Bootcamp_Intro_R.ipynb b/R_Bootcamp_Intro_R.ipynb index 5b10c11..2b5c1d7 100644 --- a/R_Bootcamp_Intro_R.ipynb +++ b/R_Bootcamp_Intro_R.ipynb @@ -441,7 +441,7 @@ "metadata": {}, "outputs": [], "source": [ - "print( combined_vector[-c(4)] )" + "print(combined_vector[-c(4)])" ] }, { @@ -649,7 +649,7 @@ "metadata": {}, "outputs": [], "source": [ - "table( is.na( here_is_a_vector ) )" + "table(is.na(here_is_a_vector))" ] }, { @@ -987,6 +987,23 @@ "str(unlist(list_1))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And also look at the difference in length between the original `list_1` and the vectorized `list_1`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(length(list_1))\n", + "print(length(unlist(list_1)))\n", + ] + }, { "cell_type": "markdown", "metadata": {}, From 1b8c029a66ede1c62a16a08bffbcd0698a6f84b1 Mon Sep 17 00:00:00 2001 From: Eric Salomaki Date: Fri, 19 May 2023 11:43:15 -0400 Subject: [PATCH 2/3] Minor formatting updates --- R_Bootcamp_Intro_R.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R_Bootcamp_Intro_R.ipynb b/R_Bootcamp_Intro_R.ipynb index 2b5c1d7..2b235d0 100644 --- a/R_Bootcamp_Intro_R.ipynb +++ b/R_Bootcamp_Intro_R.ipynb @@ -1669,7 +1669,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "So, the function itself is called `roll`, it takes the argument or formals `number_of_dice` and the body of the function uses the built-in `sample` function in R to simulate dice rolls (use ?sample to learn more about the `sample()` function). " + "So, the function itself is called `roll`, it takes the argument or formals `number_of_dice` and the body of the function uses the built-in `sample` function in R to simulate dice rolls (use `?sample` to learn more about the `sample()` function). " ] }, { From 0d6705185450ef719206e816b23fa2ca8940ca06 Mon Sep 17 00:00:00 2001 From: Eric Salomaki Date: Fri, 19 May 2023 11:59:04 -0400 Subject: [PATCH 3/3] Minor formatting updates --- R_Bootcamp_Intro_R.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R_Bootcamp_Intro_R.ipynb b/R_Bootcamp_Intro_R.ipynb index 2b235d0..f7f7498 100644 --- a/R_Bootcamp_Intro_R.ipynb +++ b/R_Bootcamp_Intro_R.ipynb @@ -1001,7 +1001,7 @@ "outputs": [], "source": [ "print(length(list_1))\n", - "print(length(unlist(list_1)))\n", + "print(length(unlist(list_1)))\n" ] }, {