Skip to content

Commit

Permalink
HLO R January 2024 ; resolving mterials for SSA
Browse files Browse the repository at this point in the history
  • Loading branch information
rmonajemi committed Jan 9, 2024
1 parent c7df7cd commit 1de3337
Show file tree
Hide file tree
Showing 31 changed files with 81,776 additions and 338,293 deletions.
Empty file added docs/HLO_202401/NA
Empty file.
56 changes: 28 additions & 28 deletions docs/HLO_202401/S01L09s_basic_vectors0.tasks.code.html
Original file line number Diff line number Diff line change
Expand Up @@ -3539,23 +3539,23 @@ <h2>Primary exercises</h2>
</ol>
<pre class="r"><code>v &lt;- rnorm( 10 ) # a vector of random numbers
v</code></pre>
<pre><code> [1] 1.9100805 0.3544851 -1.5325585 1.7951147 0.1636115 1.7985924 0.7860714 2.2636781 0.5764673 -0.6104900</code></pre>
<pre><code> [1] -0.08684587 -0.12305461 0.93499636 0.69911305 0.96411882 1.28574192 -0.49437674 1.90782428 -0.20086221 -0.26340391</code></pre>
<pre class="r"><code>v &lt;- rnorm( 10 ) # another vector of random numbers
v</code></pre>
<pre><code> [1] -2.1270588 -0.9164435 0.6007464 0.3296367 1.5966059 0.4576216 0.9890490 0.8464233 0.8824410 0.7591782</code></pre>
<pre><code> [1] -0.17723685 0.64198290 -1.74998522 -0.67957231 1.48208103 -1.23709930 -0.54653992 -1.24279637 0.06258482 1.51158781</code></pre>
<pre class="r"><code>v &lt;- rnorm( n = 15, mean = 2000, sd = 300 )
v</code></pre>
<pre><code> [1] 2182.144 1558.832 1029.785 1971.342 2292.607 1890.203 2263.458 2163.672 2070.459 2211.202 1587.938 2442.345 1995.308 1282.682 2049.964</code></pre>
<pre><code> [1] 2340.5955 1977.0104 999.0417 2336.3170 1751.8906 1667.8493 2281.3080 1359.0786 2182.9799 2264.8113 1774.7514 1947.8293 1745.1161 1812.9882 2245.1084</code></pre>
<pre class="r"><code>min( v )</code></pre>
<pre><code>[1] 1029.785</code></pre>
<pre><code>[1] 999.0417</code></pre>
<pre class="r"><code>max( v )</code></pre>
<pre><code>[1] 2442.345</code></pre>
<pre><code>[1] 2340.595</code></pre>
<pre class="r"><code>mean( v ) # is it close to 2000? try several random v vectors and see the effect of growing n</code></pre>
<pre><code>[1] 1932.796</code></pre>
<pre><code>[1] 1912.445</code></pre>
<pre class="r"><code>median( v )</code></pre>
<pre><code>[1] 2049.964</code></pre>
<pre><code>[1] 1947.829</code></pre>
<pre class="r"><code>sd( v ) # is it close to 300? try several random v vectors and see the effect of growing n</code></pre>
<pre><code>[1] 398.9423</code></pre>
<pre><code>[1] 386.8787</code></pre>
<ol start="6" style="list-style-type: decimal">
<li><em>Selecting and counting some kcal intakes. (Selecting elements by
a condition; logical vectors.)</em><br />
Expand All @@ -3569,17 +3569,17 @@ <h2>Primary exercises</h2>
</ol>
<pre class="r"><code>v &lt;- rnorm( n = 15, mean = 2000, sd = 300 )
v</code></pre>
<pre><code> [1] 1974.128 2124.418 2507.012 1301.313 1502.181 1997.364 1780.462 2044.753 1969.703 2062.499 2116.766 2018.565 2731.894 1191.757 2235.245</code></pre>
<pre><code> [1] 1916.076 1740.645 1586.926 1797.370 1883.537 2220.240 1719.392 2464.522 1889.610 1670.940 2368.731 2298.471 2415.978 2179.834 1944.372</code></pre>
<pre class="r"><code>v &lt; 2000 # TRUE corresponds to elements of vector v SMALLER THAN 2000</code></pre>
<pre><code> [1] TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE</code></pre>
<pre><code> [1] TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE</code></pre>
<pre class="r"><code>v[ v &lt; 2000 ] # selected elements of v smaller than 2000</code></pre>
<pre><code>[1] 1974.128 1301.313 1502.181 1997.364 1780.462 1969.703 1191.757</code></pre>
<pre><code>[1] 1916.076 1740.645 1586.926 1797.370 1883.537 1719.392 1889.610 1670.940 1944.372</code></pre>
<pre class="r"><code>sum( v &lt; 2000 ) # number of elements in vector v smaller than 2000</code></pre>
<pre><code>[1] 7</code></pre>
<pre><code>[1] 9</code></pre>
<pre class="r"><code>sum( !( v &lt; 2000 ) ) # number of elements in vector v GREATER OR EQUAL than 2000</code></pre>
<pre><code>[1] 8</code></pre>
<pre><code>[1] 6</code></pre>
<pre class="r"><code>sum( v &gt;= 2000 ) # same as above</code></pre>
<pre><code>[1] 8</code></pre>
<pre><code>[1] 6</code></pre>
<ol start="7" style="list-style-type: decimal">
<li><em>Head and tail.</em><br />
Often there is a need to quickly look at the beginning
Expand All @@ -3589,12 +3589,12 @@ <h2>Primary exercises</h2>
</ol>
<pre class="r"><code>v &lt;- rnorm( 20 )
v</code></pre>
<pre><code> [1] -0.58023470 0.13418014 0.23056016 -0.58765013 0.41108748 1.46311541 1.56596174 -0.11016241 0.27550940 1.48522468 -0.36450801 -0.80969937 1.67362981
[14] -0.57528622 0.67805598 0.42178202 0.06404249 0.11930765 -1.27424841 -1.27933627</code></pre>
<pre><code> [1] -0.07448741 1.78763658 -0.24168726 0.22382714 0.90324773 0.85413009 0.98366668 0.34567395 0.56134277 -1.28184912 -0.29374576 1.90902040 -2.21578592
[14] -0.05379028 -0.49776397 1.13799609 -0.27835452 -1.50099517 0.11999368 -0.05882277</code></pre>
<pre class="r"><code>head( v, 5 )</code></pre>
<pre><code>[1] -0.5802347 0.1341801 0.2305602 -0.5876501 0.4110875</code></pre>
<pre><code>[1] -0.07448741 1.78763658 -0.24168726 0.22382714 0.90324773</code></pre>
<pre class="r"><code>tail( v, 7 )</code></pre>
<pre><code>[1] -0.57528622 0.67805598 0.42178202 0.06404249 0.11930765 -1.27424841 -1.27933627</code></pre>
<pre><code>[1] -0.05379028 -0.49776397 1.13799609 -0.27835452 -1.50099517 0.11999368 -0.05882277</code></pre>
<ol start="8" style="list-style-type: decimal">
<li><em>Elements of a vector.</em><br />
Let’s assume that eight persons had caloric intakes of 2122, 2616, NA,
Expand Down Expand Up @@ -3745,18 +3745,18 @@ <h2>Extra exercises</h2>
<pre class="r"><code>fileName &lt;- &quot;test.txt&quot;
v &lt;- sample( 1:100, 10 )
v</code></pre>
<pre><code> [1] 41 67 46 9 81 20 95 12 21 76</code></pre>
<pre><code> [1] 28 24 20 36 30 90 32 19 23 60</code></pre>
<pre class="r"><code>writeLines( as.character( v ) ) # conversion to character needed</code></pre>
<pre><code>41
67
46
9
81
<pre><code>28
24
20
95
12
21
76</code></pre>
36
30
90
32
19
23
60</code></pre>
<pre class="r"><code>writeLines( as.character( v ), con = fileName )
w &lt;- readLines( con = fileName )
identical( v, w ) # numbers are not the same as their text representation</code></pre>
Expand Down
58 changes: 29 additions & 29 deletions docs/HLO_202401/S01L10s_basic_vectors0a.tasks.code.html
Original file line number Diff line number Diff line change
Expand Up @@ -3539,23 +3539,23 @@ <h2>Primary exercises</h2>
</ol>
<pre class="r"><code>v &lt;- rnorm( 10 ) # a vector of random numbers
v</code></pre>
<pre><code> [1] 0.7954721 -0.0110378 -0.4907300 -0.1870045 0.2163163 0.4602967 -0.4815889 1.2922328 -0.3749538 -0.7398685</code></pre>
<pre><code> [1] 0.7417953 0.3737005 -0.1032475 -0.1443352 -1.6853115 -0.6388525 0.5076975 1.9223003 0.3482098 0.1984921</code></pre>
<pre class="r"><code>v &lt;- rnorm( 10 ) # another vector of random numbers
v</code></pre>
<pre><code> [1] -0.610421261 -0.632929152 0.848193731 -1.755084158 0.060185487 1.061095238 -0.750328721 -1.619968118 0.007059658 -0.413613139</code></pre>
<pre><code> [1] 0.044663134 -0.024589302 -0.762325784 -0.099985600 -0.739721425 -0.675194542 0.169422149 -0.074578394 -0.008380466 -0.866278195</code></pre>
<pre class="r"><code>v &lt;- rnorm( n = 15, mean = 2000, sd = 300 )
v</code></pre>
<pre><code> [1] 2009.109 2484.061 2282.905 1763.897 1859.543 1622.650 1514.489 1690.456 2437.509 1838.286 1859.968 2168.717 2519.566 1792.545 2332.606</code></pre>
<pre><code> [1] 2097.551 1542.531 2029.045 2062.238 1852.726 1645.120 1933.924 2690.972 2344.736 2622.540 1555.883 1742.117 1933.061 2019.946 2386.710</code></pre>
<pre class="r"><code>min( v )</code></pre>
<pre><code>[1] 1514.489</code></pre>
<pre><code>[1] 1542.531</code></pre>
<pre class="r"><code>max( v )</code></pre>
<pre><code>[1] 2519.566</code></pre>
<pre><code>[1] 2690.972</code></pre>
<pre class="r"><code>mean( v ) # is it close to 2000? try several random v vectors and see the effect of growing n</code></pre>
<pre><code>[1] 2011.754</code></pre>
<pre><code>[1] 2030.607</code></pre>
<pre class="r"><code>median( v )</code></pre>
<pre><code>[1] 1859.968</code></pre>
<pre><code>[1] 2019.946</code></pre>
<pre class="r"><code>sd( v ) # is it close to 300? try several random v vectors and see the effect of growing n</code></pre>
<pre><code>[1] 332.8469</code></pre>
<pre><code>[1] 354.9108</code></pre>
<ol start="6" style="list-style-type: decimal">
<li><em>Selecting and counting some kcal intakes. (Selecting elements by
a condition; logical vectors.)</em><br />
Expand All @@ -3569,17 +3569,17 @@ <h2>Primary exercises</h2>
</ol>
<pre class="r"><code>v &lt;- rnorm( n = 15, mean = 2000, sd = 300 )
v</code></pre>
<pre><code> [1] 2350.128 2133.038 1688.507 1608.779 1979.867 2220.151 2147.946 1734.274 2035.295 1564.875 2077.460 1670.738 2109.570 1975.746 2121.184</code></pre>
<pre><code> [1] 1789.818 2095.682 2303.251 2046.704 1571.009 2033.162 2220.454 1834.578 2527.301 2416.129 2160.302 2155.554 1656.795 1780.393 2426.988</code></pre>
<pre class="r"><code>v &lt; 2000 # TRUE corresponds to elements of vector v SMALLER THAN 2000</code></pre>
<pre><code> [1] FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE</code></pre>
<pre><code> [1] TRUE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE</code></pre>
<pre class="r"><code>v[ v &lt; 2000 ] # selected elements of v smaller than 2000</code></pre>
<pre><code>[1] 1688.507 1608.779 1979.867 1734.274 1564.875 1670.738 1975.746</code></pre>
<pre><code>[1] 1789.818 1571.009 1834.578 1656.795 1780.393</code></pre>
<pre class="r"><code>sum( v &lt; 2000 ) # number of elements in vector v smaller than 2000</code></pre>
<pre><code>[1] 7</code></pre>
<pre><code>[1] 5</code></pre>
<pre class="r"><code>sum( !( v &lt; 2000 ) ) # number of elements in vector v GREATER OR EQUAL than 2000</code></pre>
<pre><code>[1] 8</code></pre>
<pre><code>[1] 10</code></pre>
<pre class="r"><code>sum( v &gt;= 2000 ) # same as above</code></pre>
<pre><code>[1] 8</code></pre>
<pre><code>[1] 10</code></pre>
<ol start="7" style="list-style-type: decimal">
<li><em>Head and tail.</em><br />
Often there is a need to quickly look at the beginning
Expand All @@ -3589,12 +3589,12 @@ <h2>Primary exercises</h2>
</ol>
<pre class="r"><code>v &lt;- rnorm( 20 )
v</code></pre>
<pre><code> [1] -1.2045435 -0.8888849 -0.4875591 -0.8603972 1.2857674 1.0748361 -1.0896903 0.2198662 -0.1588183 0.1006874 0.2048456 0.0851585 0.1297533 -1.0237506
[15] 0.2890568 -0.8618261 0.1333541 0.2800890 0.9490818 -0.9045166</code></pre>
<pre><code> [1] -1.78907853 -0.75024471 -1.00115515 1.99994540 -1.99803625 1.10225645 0.91155143 -1.88657106 -1.42925202 0.69773983 0.51099752 -0.33735161 0.88145166
[14] 0.47859768 -1.17542927 -0.02804497 0.97853084 -0.56513801 -0.39842986 -0.20884662</code></pre>
<pre class="r"><code>head( v, 5 )</code></pre>
<pre><code>[1] -1.2045435 -0.8888849 -0.4875591 -0.8603972 1.2857674</code></pre>
<pre><code>[1] -1.7890785 -0.7502447 -1.0011551 1.9999454 -1.9980362</code></pre>
<pre class="r"><code>tail( v, 7 )</code></pre>
<pre><code>[1] -1.0237506 0.2890568 -0.8618261 0.1333541 0.2800890 0.9490818 -0.9045166</code></pre>
<pre><code>[1] 0.47859768 -1.17542927 -0.02804497 0.97853084 -0.56513801 -0.39842986 -0.20884662</code></pre>
<ol start="8" style="list-style-type: decimal">
<li><em>Elements of a vector.</em><br />
Let’s assume that eight persons had caloric intakes of 2122, 2616, NA,
Expand Down Expand Up @@ -3745,18 +3745,18 @@ <h2>Extra exercises</h2>
<pre class="r"><code>fileName &lt;- &quot;test.txt&quot;
v &lt;- sample( 1:100, 10 )
v</code></pre>
<pre><code> [1] 47 12 93 8 32 73 61 68 59 27</code></pre>
<pre><code> [1] 79 69 18 75 90 5 83 13 30 11</code></pre>
<pre class="r"><code>writeLines( as.character( v ) ) # conversion to character needed</code></pre>
<pre><code>47
12
93
8
32
73
61
68
59
27</code></pre>
<pre><code>79
69
18
75
90
5
83
13
30
11</code></pre>
<pre class="r"><code>writeLines( as.character( v ), con = fileName )
w &lt;- readLines( con = fileName )
identical( v, w ) # numbers are not the same as their text representation</code></pre>
Expand Down
3,625 changes: 3,625 additions & 0 deletions docs/HLO_202401/S03L03l_dplyr_summarise0.html

Large diffs are not rendered by default.

3,445 changes: 3,445 additions & 0 deletions docs/HLO_202401/S03L03p_dplyr_summarise0.tasks.nocode.html

Large diffs are not rendered by default.

3,684 changes: 3,684 additions & 0 deletions docs/HLO_202401/S03L03s_dplyr_summarise0.tasks.code.html

Large diffs are not rendered by default.

3,587 changes: 3,587 additions & 0 deletions docs/HLO_202401/S03L04l_dplyr_group0.html

Large diffs are not rendered by default.

3,467 changes: 3,467 additions & 0 deletions docs/HLO_202401/S03L04p_dplyr_group0.tasks.nocode.html

Large diffs are not rendered by default.

3,641 changes: 3,641 additions & 0 deletions docs/HLO_202401/S03L04s_dplyr_group0.tasks.code.html

Large diffs are not rendered by default.

3,516 changes: 3,516 additions & 0 deletions docs/HLO_202401/S04L01l_ggplot_basics0.html

Large diffs are not rendered by default.

3,448 changes: 3,448 additions & 0 deletions docs/HLO_202401/S04L01p_ggplot_basics0.tasks.nocode.html

Large diffs are not rendered by default.

3,564 changes: 3,564 additions & 0 deletions docs/HLO_202401/S04L01s_ggplot_basics0.tasks.code.html

Large diffs are not rendered by default.

3,561 changes: 3,561 additions & 0 deletions docs/HLO_202401/S04L02l_ggplot_scales0.html

Large diffs are not rendered by default.

3,425 changes: 3,425 additions & 0 deletions docs/HLO_202401/S04L02p_ggplot_scales0.tasks.nocode.html

Large diffs are not rendered by default.

3,526 changes: 3,526 additions & 0 deletions docs/HLO_202401/S04L02s_ggplot_scales0.tasks.code.html

Large diffs are not rendered by default.

3,514 changes: 3,514 additions & 0 deletions docs/HLO_202401/S04L03l_ggplot_facets_themes0.html

Large diffs are not rendered by default.

3,456 changes: 3,456 additions & 0 deletions docs/HLO_202401/S04L03p_ggplot_facets_themes0.tasks.nocode.html

Large diffs are not rendered by default.

3,591 changes: 3,591 additions & 0 deletions docs/HLO_202401/S04L03s_ggplot_facets_themes0.tasks.code.html

Large diffs are not rendered by default.

3,524 changes: 3,524 additions & 0 deletions docs/HLO_202401/S04L04l_basic_lists0.html

Large diffs are not rendered by default.

3,605 changes: 3,605 additions & 0 deletions docs/HLO_202401/S04L04p_basic_lists0.tasks.nocode.html

Large diffs are not rendered by default.

3,936 changes: 3,936 additions & 0 deletions docs/HLO_202401/S04L04s_basic_lists0.tasks.code.html

Large diffs are not rendered by default.

3,526 changes: 3,526 additions & 0 deletions docs/HLO_202401/S04L05l_basic_factors0.html

Large diffs are not rendered by default.

3,480 changes: 3,480 additions & 0 deletions docs/HLO_202401/S04L05p_basic_factors0.tasks.nocode.html

Large diffs are not rendered by default.

3,667 changes: 3,667 additions & 0 deletions docs/HLO_202401/S04L05s_basic_factors0.tasks.code.html

Large diffs are not rendered by default.

3,402 changes: 3,402 additions & 0 deletions docs/HLO_202401/S04L06l_ed0.html

Large diffs are not rendered by default.

Loading

0 comments on commit 1de3337

Please sign in to comment.