diff --git a/R_Bootcamp_Intro_R.ipynb b/R_Bootcamp_Intro_R.ipynb index 5b10c11..f7f7498 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": {}, @@ -1652,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). " ] }, {