From b411b2a0fcde3c04897e3a07af4b64357b922d72 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 12 Dec 2024 18:12:27 +0000 Subject: [PATCH] Autobuild --- docs/data/writeThisMultipleXLSX.xlsx | Bin 6444 -> 6444 bytes docs/data/writeThisXLSX.xlsx | Bin 5814 -> 5814 bytes .../answers/ConditionsAndLoops_answers.html | 0 .../answers/FactorsAndDataframes_answers.html | 0 .../exercises/answers/Matrices_answers.html | 1 - .../ConditionsAndLoops_exercise.html | 0 .../FactorsAndDataframes_exercise.html | 0 .../exercises/Matrices_exercise.html | 1 - .../singlepage/introToR_Session1.html | 64 +- .../singlepage/introToR_Session2.html | 12 +- .../slides/introToR_Session1.html | 64 +- .../slides/introToR_Session2.html | 12 +- r_course/data/writeThisMultipleXLSX.xlsx | Bin 6444 -> 6444 bytes r_course/data/writeThisXLSX.xlsx | Bin 5814 -> 5814 bytes .../answers/ConditionsAndLoops_answers.html | 714 ++++++++++++++++++ .../answers/FactorsAndDataframes_answers.html | 695 +++++++++++++++++ .../exercises/answers/Matrices_answers.html | 592 +++++++++++++++ .../ConditionsAndLoops_exercise.html | 499 ++++++++++++ .../FactorsAndDataframes_exercise.html | 651 ++++++++++++++++ .../exercises/Matrices_exercise.html | 571 ++++++++++++++ .../singlepage/introToR_Session1.html | 64 +- .../singlepage/introToR_Session2.html | 12 +- .../slides/introToR_Session1.html | 64 +- .../slides/introToR_Session2.html | 12 +- 24 files changed, 3874 insertions(+), 154 deletions(-) rename r_course/exercises/answers/conditionsAndLoops_answers.html => docs/exercises/answers/ConditionsAndLoops_answers.html (100%) rename r_course/exercises/answers/factorsAndDataframes_answers.html => docs/exercises/answers/FactorsAndDataframes_answers.html (100%) rename r_course/exercises/answers/matrices_answers.html => docs/exercises/answers/Matrices_answers.html (99%) rename r_course/exercises/exercises/conditionsAndLoops_exercise.html => docs/exercises/exercises/ConditionsAndLoops_exercise.html (100%) rename r_course/exercises/exercises/factorsAndDataframes_exercise.html => docs/exercises/exercises/FactorsAndDataframes_exercise.html (100%) rename r_course/exercises/exercises/matrices_exercise.html => docs/exercises/exercises/Matrices_exercise.html (99%) create mode 100644 r_course/exercises/answers/ConditionsAndLoops_answers.html create mode 100644 r_course/exercises/answers/FactorsAndDataframes_answers.html create mode 100644 r_course/exercises/answers/Matrices_answers.html create mode 100644 r_course/exercises/exercises/ConditionsAndLoops_exercise.html create mode 100644 r_course/exercises/exercises/FactorsAndDataframes_exercise.html create mode 100644 r_course/exercises/exercises/Matrices_exercise.html diff --git a/docs/data/writeThisMultipleXLSX.xlsx b/docs/data/writeThisMultipleXLSX.xlsx index 520ec2742caa1e5aa72d5573b2589dbaea7698ff..4c1fbaabd2b81c7457ef8577b20220890b89fa35 100644 GIT binary patch delta 319 zcmV-F0l@yOGORMNqZ0(6NNOFweHABh z67VUYi!`&}&MqpKd(|d?;Jh@tLL|#k0-75kbyJ~_%_?1>#0RDYYmJ5q_2AL6eki%6 z+&Fl1#)1nHd=f$0Q*JA?3&B#1J>P+1K8p?=#jSCQg?M!hwv7L<25^z*bF3hLFu?-D z2ViPPB03=jACdOgwF5wK3@s?o!DEsUeDMZw%1;&y%9T^e&|8?ap2g9<_i{9LU6*yU z!5Z@u{I!04A4W~3KCFrZs!PEscff*ib&0Ppad9p4VI5bzl^~w_s876|207M&NMZnb zjC)o-XU{L26{?H8cuYwV&xR}@linB_ Rvj!ET0|euOZMu`K7=Os(kxc*q delta 319 zcmV-F0l@yOGORMNqZ0&cQz(IxrxPoG*(s$6+kv*^)IgywExie86NNOFwePt(c z638i_i!`&}&MqpKJJltB;Jh@tLU~3|0-75kbz7m2W|cmo#0RDY>x_m94dBtTzAL$< z+&Fl1#)1nHd=f$0Q*JA?4Z%{3J>P<2K8p?=#f@=_g?M!>wv7L<7H~nx16B}!m|%h7 z5t!PUhz>}>XQcgg-2@OELk9|U@Ho$MeDVfx%3m#*lryK2VX$!3dK72(&db@@_kGqc zCTq-}Yhjm=>MuK=6qJHJ=Fvz|RL=pqg zecYq+xp;nQR;VsWai8WzJPj!vC?T}SzsHsr^(UY@G`X301nhHPeuDZRP)h>@linB_ Rvj!ET0|aYRD1no$7=PkVlX3t6 diff --git a/docs/data/writeThisXLSX.xlsx b/docs/data/writeThisXLSX.xlsx index 85bc7fb3f6ca5acf92c1f0ec2446e782f7a2a62a..6bd17e936f9c831bad6358b4d0e594e5faeb5300 100644 GIT binary patch delta 311 zcmV-70m%NgEw(MNco78Sf^E8!d=V>u%PAoU+kv*^)IgyrExie86NNOFweHABh z67VUYi!`&}&MqpKd(|d?;Jh@tLL|#k0-75kbyJ~_%_?1>#0RDYYmJ5q_2AL6eki%6 z+&Fl1#)1nHd=f$0Q*JA?3&B#1J>P+1K8p?=#jSCQg?M!hwv7L<25^z*bF3hLFu?-D z2ViPPB03=jACdOgwF5wK3@s?o!DEsUeDMZw%1;&y%9T^e&|8?ap2g9<_i{9LU6*yU z!5Z@u{I!04A4W~3KCFrZs!PEscff*ib&0Ppad9p4VI5bzl^~w_s876|207M&NMZnb zjC)o-XU{L26{?H8cuYwV&xR}*C@CnJe;-=j)L($=)Z}jB8F0*f`w8lQv%L~_0|euO JZMu^;7JvM@j>7-| delta 311 zcmV-70m%NgEw(MNco76^Qz(Ixd=V>u*(s$6+kv*^)IgywExie86NNOFwePt(c z638i_i!`&}&MqpKJJltB;Jh@tLU~3|0-75kbz7m2W|cmo#0RDY>x_m94dBtTzAL$< z+&Fl1#)1nHd=f$0Q*JA?4Z%{3J>P<2K8p?=#f@=_g?M!>wv7L<7H~nx16B}!m|%h7 z5t!PUhz>}>XQcgg-2@OELk9|U@Ho$MeDVfx%3m#*lryK2VX$!3dK72(&db@@_kGqc zCTq-}Yhjm=>MuK=6qJHJ=Fvz|RL=pqg zecYq+xp;nQR;VsWai8WzJPj!rC?T}SzsHsr^(UY@G`X301nhHPeuDZRv%L~_0|aYR JD1nnV7JvKKkmvva diff --git a/r_course/exercises/answers/conditionsAndLoops_answers.html b/docs/exercises/answers/ConditionsAndLoops_answers.html similarity index 100% rename from r_course/exercises/answers/conditionsAndLoops_answers.html rename to docs/exercises/answers/ConditionsAndLoops_answers.html diff --git a/r_course/exercises/answers/factorsAndDataframes_answers.html b/docs/exercises/answers/FactorsAndDataframes_answers.html similarity index 100% rename from r_course/exercises/answers/factorsAndDataframes_answers.html rename to docs/exercises/answers/FactorsAndDataframes_answers.html diff --git a/r_course/exercises/answers/matrices_answers.html b/docs/exercises/answers/Matrices_answers.html similarity index 99% rename from r_course/exercises/answers/matrices_answers.html rename to docs/exercises/answers/Matrices_answers.html index e01294d..c9b6785 100644 --- a/r_course/exercises/answers/matrices_answers.html +++ b/docs/exercises/answers/Matrices_answers.html @@ -439,7 +439,6 @@

Introduction to R.

-

These exercises cover the matrices sections of Introduction to R.

Exercise 1

  • Create a matrix containing information on gene names Gene_1, Gene_2, diff --git a/r_course/exercises/exercises/conditionsAndLoops_exercise.html b/docs/exercises/exercises/ConditionsAndLoops_exercise.html similarity index 100% rename from r_course/exercises/exercises/conditionsAndLoops_exercise.html rename to docs/exercises/exercises/ConditionsAndLoops_exercise.html diff --git a/r_course/exercises/exercises/factorsAndDataframes_exercise.html b/docs/exercises/exercises/FactorsAndDataframes_exercise.html similarity index 100% rename from r_course/exercises/exercises/factorsAndDataframes_exercise.html rename to docs/exercises/exercises/FactorsAndDataframes_exercise.html diff --git a/r_course/exercises/exercises/matrices_exercise.html b/docs/exercises/exercises/Matrices_exercise.html similarity index 99% rename from r_course/exercises/exercises/matrices_exercise.html rename to docs/exercises/exercises/Matrices_exercise.html index f114b80..8011841 100644 --- a/r_course/exercises/exercises/matrices_exercise.html +++ b/docs/exercises/exercises/Matrices_exercise.html @@ -439,7 +439,6 @@

    Introduction to R.

    -

    These exercises cover the matrices sections of Introduction to R.

    Exercise 1

    • Create a matrix containing information on gene names Gene_1, Gene_2, diff --git a/docs/presentations/singlepage/introToR_Session1.html b/docs/presentations/singlepage/introToR_Session1.html index 1448a2d..6b9a2a6 100644 --- a/docs/presentations/singlepage/introToR_Session1.html +++ b/docs/presentations/singlepage/introToR_Session1.html @@ -3082,7 +3082,7 @@

      More complex objects

      manage Dates or Times.

      Time <- Sys.time()
       Time
      -
      ## [1] "2024-12-12 02:00:20 UTC"
      +
      ## [1] "2024-12-12 18:12:15 UTC"

      More complex objects

      @@ -3110,11 +3110,11 @@

      More complex objects

      More complex objects

      We can also use the arithmetic operations with our time objects.

      Time
      -
      ## [1] "2024-12-12 02:00:20 UTC"
      +
      ## [1] "2024-12-12 18:12:15 UTC"
      Time - 120
      -
      ## [1] "2024-12-12 01:58:20 UTC"
      +
      ## [1] "2024-12-12 18:10:15 UTC"
      TimeNow - Time
      -
      ## Time difference of 0.1078458 secs
      +
      ## Time difference of 0.1084907 secs

      More complex objects

      @@ -3125,18 +3125,18 @@

      More complex objects

      We can also change the timezone by specifying a tz parameter

      format(Time,format="%H O'Clock %p %A on %B %dth")
      -
      ## [1] "02 O'Clock AM Thursday on December 12th"
      +
      ## [1] "18 O'Clock PM Thursday on December 12th"
      format(Time,format="%H O'Clock %p %A on %B %dth",tz = "GMT")
      -
      ## [1] "02 O'Clock AM Thursday on December 12th"
      +
      ## [1] "18 O'Clock PM Thursday on December 12th"

      Complex to base objects

      Most of the time we can convert more complex object back to our basic object types we are more familar with.

      as.character(Time)
      -
      ## [1] "2024-12-12 02:00:20.799085"
      +
      ## [1] "2024-12-12 18:12:15.725485"
      as.numeric(TimeNow-Time)
      -
      ## [1] 0.1078458
      +
      ## [1] 0.1084907

      Complex objects summary

      @@ -3245,13 +3245,13 @@

      Data from external sources

      Gene_a -3.362639 +3.567960 -3.523646 +3.751809 -4.704296 +5.156441 @@ -3259,13 +3259,13 @@

      Data from external sources

      Gene_b -2.768784 +3.969382 -2.772147 +2.563824 -4.844562 +4.743562 @@ -3273,13 +3273,13 @@

      Data from external sources

      Gene_c -5.078882 +4.874842 -3.713159 +5.002982 -6.027094 +4.089564 @@ -3287,13 +3287,13 @@

      Data from external sources

      Gene_d -3.706215 +4.319586 -4.482517 +3.346743 -4.814330 +4.855645 @@ -3301,13 +3301,13 @@

      Data from external sources

      Gene_e -10.442474 +9.767292 -10.785325 +8.984913 -8.939309 +9.525845 @@ -3315,13 +3315,13 @@

      Data from external sources

      Gene_f -9.620548 +11.038205 -10.042143 +10.778420 -10.399179 +10.270429 @@ -3329,13 +3329,13 @@

      Data from external sources

      Gene_g -10.155296 +8.517023 -9.964465 +11.603366 -9.048469 +7.418904 @@ -3343,13 +3343,13 @@

      Data from external sources

      Gene_h -10.082693 +9.140641 -12.054921 +9.419702 -10.230600 +10.145435 diff --git a/docs/presentations/singlepage/introToR_Session2.html b/docs/presentations/singlepage/introToR_Session2.html index 7d1dd2c..481de52 100644 --- a/docs/presentations/singlepage/introToR_Session2.html +++ b/docs/presentations/singlepage/introToR_Session2.html @@ -2390,8 +2390,8 @@

      Custom function example

      A <- rnorm(20) my_zscore(my_number=A[1], my_vector=A)
      -
      ## Mean is -0.0473813821205204
      -
      ## [1] 2.066187
      +
      ## Mean is 0.260665894154018
      +
      ## [1] -0.2426098

      Debugging functions

      @@ -2406,10 +2406,10 @@

      Debugging functions

      Custom functions and apply

      These custom functions can also be utilized with apply.

      sapply(A, my_zscore, my_vector=A)
      -
      ##  [1]  2.06618698  0.17165772 -0.71309305  0.04463075 -1.24264432  0.21368949
      -##  [7] -0.82084457  0.89006732 -0.57284618 -0.46639582 -1.28333645  0.98048258
      -## [13]  1.31683429 -0.36486729 -0.02032230 -0.68673550  0.13403087  1.02971875
      -## [19]  1.13413397 -1.81034725
      +
      ##  [1] -0.24260979  0.37093999  0.58712023  0.81503665  0.92783453  0.54524311
      +##  [7] -1.15824154 -0.38544962  0.08283829  0.73612828 -1.39531982 -0.48690779
      +## [13] -2.08700758  1.41872341 -0.02320079  0.08587476  1.50147491 -1.67344992
      +## [19]  0.86495743 -0.48398475
      diff --git a/docs/presentations/slides/introToR_Session1.html b/docs/presentations/slides/introToR_Session1.html index bd32505..a0a8e0c 100644 --- a/docs/presentations/slides/introToR_Session1.html +++ b/docs/presentations/slides/introToR_Session1.html @@ -2722,7 +2722,7 @@ ``` ``` -## [1] "2024-12-12 02:00:18 UTC" +## [1] "2024-12-12 18:12:13 UTC" ``` --- @@ -2777,7 +2777,7 @@ ``` ``` -## [1] "2024-12-12 02:00:18 UTC" +## [1] "2024-12-12 18:12:13 UTC" ``` ``` r @@ -2785,7 +2785,7 @@ ``` ``` -## [1] "2024-12-12 01:58:18 UTC" +## [1] "2024-12-12 18:10:13 UTC" ``` ``` r @@ -2793,7 +2793,7 @@ ``` ``` -## Time difference of 0.1020856 secs +## Time difference of 0.1018271 secs ``` --- @@ -2811,7 +2811,7 @@ ``` ``` -## [1] "02 O'Clock AM Thursday on December 12th" +## [1] "18 O'Clock PM Thursday on December 12th" ``` ``` r @@ -2819,7 +2819,7 @@ ``` ``` -## [1] "02 O'Clock AM Thursday on December 12th" +## [1] "18 O'Clock PM Thursday on December 12th" ``` --- @@ -2833,7 +2833,7 @@ ``` ``` -## [1] "2024-12-12 02:00:18.932222" +## [1] "2024-12-12 18:12:13.836075" ``` ``` r @@ -2841,7 +2841,7 @@ ``` ``` -## [1] 0.1020856 +## [1] 0.1018271 ``` --- @@ -2958,51 +2958,51 @@ <tbody> <tr> <td style="text-align:left;"> Gene_a </td> - <td style="text-align:right;"> 4.474330 </td> - <td style="text-align:right;"> 3.317462 </td> - <td style="text-align:right;"> 4.099006 </td> + <td style="text-align:right;"> 3.610115 </td> + <td style="text-align:right;"> 4.853242 </td> + <td style="text-align:right;"> 3.282902 </td> </tr> <tr> <td style="text-align:left;"> Gene_b </td> - <td style="text-align:right;"> 4.981917 </td> - <td style="text-align:right;"> 2.944475 </td> - <td style="text-align:right;"> 4.085144 </td> + <td style="text-align:right;"> 3.993367 </td> + <td style="text-align:right;"> 4.172051 </td> + <td style="text-align:right;"> 4.435115 </td> </tr> <tr> <td style="text-align:left;"> Gene_c </td> - <td style="text-align:right;"> 4.134901 </td> - <td style="text-align:right;"> 2.906727 </td> - <td style="text-align:right;"> 3.657244 </td> + <td style="text-align:right;"> 2.771158 </td> + <td style="text-align:right;"> 3.838969 </td> + <td style="text-align:right;"> 5.041786 </td> </tr> <tr> <td style="text-align:left;"> Gene_d </td> - <td style="text-align:right;"> 4.060022 </td> - <td style="text-align:right;"> 3.431809 </td> - <td style="text-align:right;"> 3.067610 </td> + <td style="text-align:right;"> 4.215114 </td> + <td style="text-align:right;"> 3.588607 </td> + <td style="text-align:right;"> 5.006741 </td> </tr> <tr> <td style="text-align:left;"> Gene_e </td> - <td style="text-align:right;"> 8.375376 </td> - <td style="text-align:right;"> 11.302259 </td> - <td style="text-align:right;"> 9.741597 </td> + <td style="text-align:right;"> 9.374658 </td> + <td style="text-align:right;"> 12.053861 </td> + <td style="text-align:right;"> 10.350153 </td> </tr> <tr> <td style="text-align:left;"> Gene_f </td> - <td style="text-align:right;"> 10.681901 </td> - <td style="text-align:right;"> 8.988139 </td> - <td style="text-align:right;"> 9.882073 </td> + <td style="text-align:right;"> 10.352955 </td> + <td style="text-align:right;"> 9.145474 </td> + <td style="text-align:right;"> 9.897497 </td> </tr> <tr> <td style="text-align:left;"> Gene_g </td> - <td style="text-align:right;"> 8.381877 </td> - <td style="text-align:right;"> 10.246497 </td> - <td style="text-align:right;"> 9.182067 </td> + <td style="text-align:right;"> 11.078091 </td> + <td style="text-align:right;"> 10.386456 </td> + <td style="text-align:right;"> 7.507547 </td> </tr> <tr> <td style="text-align:left;"> Gene_h </td> - <td style="text-align:right;"> 10.374626 </td> - <td style="text-align:right;"> 10.020247 </td> - <td style="text-align:right;"> 9.315545 </td> + <td style="text-align:right;"> 10.949266 </td> + <td style="text-align:right;"> 8.658287 </td> + <td style="text-align:right;"> 9.715341 </td> </tr> </tbody> </table> diff --git a/docs/presentations/slides/introToR_Session2.html b/docs/presentations/slides/introToR_Session2.html index 5aa9154..c6e0540 100644 --- a/docs/presentations/slides/introToR_Session2.html +++ b/docs/presentations/slides/introToR_Session2.html @@ -1388,11 +1388,11 @@ ``` ``` -## Mean is -0.0285571678374593 +## Mean is 0.212886120819524 ``` ``` -## [1] 0.02294925 +## [1] -0.1614368 ``` --- @@ -1417,10 +1417,10 @@ ``` ``` -## [1] 0.02294925 -0.37163355 -2.39999644 -0.16341592 -0.18844930 0.10238615 -## [7] 0.14811348 -0.55440560 -0.57582177 1.34189421 0.87050042 0.01626120 -## [13] 0.38468103 0.73310269 -1.72875890 -0.10449957 2.10033687 0.74667590 -## [19] 0.54591787 -0.92583802 +## [1] -0.16143681 0.89292580 -0.20283823 -0.66093683 0.74770696 -1.12698358 +## [7] 1.24983984 0.68528159 1.15367603 0.65217918 0.38289490 1.28464447 +## [13] -0.72711595 0.35867638 -0.46620195 0.98732824 -1.98668058 -1.45041296 +## [19] -1.54257769 -0.06996881 ``` diff --git a/r_course/data/writeThisMultipleXLSX.xlsx b/r_course/data/writeThisMultipleXLSX.xlsx index 520ec2742caa1e5aa72d5573b2589dbaea7698ff..4c1fbaabd2b81c7457ef8577b20220890b89fa35 100644 GIT binary patch delta 319 zcmV-F0l@yOGORMNqZ0(6NNOFweHABh z67VUYi!`&}&MqpKd(|d?;Jh@tLL|#k0-75kbyJ~_%_?1>#0RDYYmJ5q_2AL6eki%6 z+&Fl1#)1nHd=f$0Q*JA?3&B#1J>P+1K8p?=#jSCQg?M!hwv7L<25^z*bF3hLFu?-D z2ViPPB03=jACdOgwF5wK3@s?o!DEsUeDMZw%1;&y%9T^e&|8?ap2g9<_i{9LU6*yU z!5Z@u{I!04A4W~3KCFrZs!PEscff*ib&0Ppad9p4VI5bzl^~w_s876|207M&NMZnb zjC)o-XU{L26{?H8cuYwV&xR}@linB_ Rvj!ET0|euOZMu`K7=Os(kxc*q delta 319 zcmV-F0l@yOGORMNqZ0&cQz(IxrxPoG*(s$6+kv*^)IgywExie86NNOFwePt(c z638i_i!`&}&MqpKJJltB;Jh@tLU~3|0-75kbz7m2W|cmo#0RDY>x_m94dBtTzAL$< z+&Fl1#)1nHd=f$0Q*JA?4Z%{3J>P<2K8p?=#f@=_g?M!>wv7L<7H~nx16B}!m|%h7 z5t!PUhz>}>XQcgg-2@OELk9|U@Ho$MeDVfx%3m#*lryK2VX$!3dK72(&db@@_kGqc zCTq-}Yhjm=>MuK=6qJHJ=Fvz|RL=pqg zecYq+xp;nQR;VsWai8WzJPj!vC?T}SzsHsr^(UY@G`X301nhHPeuDZRP)h>@linB_ Rvj!ET0|aYRD1no$7=PkVlX3t6 diff --git a/r_course/data/writeThisXLSX.xlsx b/r_course/data/writeThisXLSX.xlsx index 85bc7fb3f6ca5acf92c1f0ec2446e782f7a2a62a..6bd17e936f9c831bad6358b4d0e594e5faeb5300 100644 GIT binary patch delta 311 zcmV-70m%NgEw(MNco78Sf^E8!d=V>u%PAoU+kv*^)IgyrExie86NNOFweHABh z67VUYi!`&}&MqpKd(|d?;Jh@tLL|#k0-75kbyJ~_%_?1>#0RDYYmJ5q_2AL6eki%6 z+&Fl1#)1nHd=f$0Q*JA?3&B#1J>P+1K8p?=#jSCQg?M!hwv7L<25^z*bF3hLFu?-D z2ViPPB03=jACdOgwF5wK3@s?o!DEsUeDMZw%1;&y%9T^e&|8?ap2g9<_i{9LU6*yU z!5Z@u{I!04A4W~3KCFrZs!PEscff*ib&0Ppad9p4VI5bzl^~w_s876|207M&NMZnb zjC)o-XU{L26{?H8cuYwV&xR}*C@CnJe;-=j)L($=)Z}jB8F0*f`w8lQv%L~_0|euO JZMu^;7JvM@j>7-| delta 311 zcmV-70m%NgEw(MNco76^Qz(Ixd=V>u*(s$6+kv*^)IgywExie86NNOFwePt(c z638i_i!`&}&MqpKJJltB;Jh@tLU~3|0-75kbz7m2W|cmo#0RDY>x_m94dBtTzAL$< z+&Fl1#)1nHd=f$0Q*JA?4Z%{3J>P<2K8p?=#f@=_g?M!>wv7L<7H~nx16B}!m|%h7 z5t!PUhz>}>XQcgg-2@OELk9|U@Ho$MeDVfx%3m#*lryK2VX$!3dK72(&db@@_kGqc zCTq-}Yhjm=>MuK=6qJHJ=Fvz|RL=pqg zecYq+xp;nQR;VsWai8WzJPj!rC?T}SzsHsr^(UY@G`X301nhHPeuDZRv%L~_0|aYR JD1nnV7JvKKkmvva diff --git a/r_course/exercises/answers/ConditionsAndLoops_answers.html b/r_course/exercises/answers/ConditionsAndLoops_answers.html new file mode 100644 index 0000000..cc7526c --- /dev/null +++ b/r_course/exercises/answers/ConditionsAndLoops_answers.html @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + +Conditional branching and looping in R + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +

      +  +

      +

      These exercises are about the conditions and loops sections of Introduction +to R.

      +

      Exercise 1 - If Else

      +
        +
      • Build an if statement that test if x is a negative number. Write a +print statement that will confirm if x is less than 0. Test it with +several values of x.
      • +
      +
      x<- 42
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}
      +
      +x <- -42
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}
      +
      ## [1] "It's a negative number!"
      +
        +
      • Modify the previous if statement to include an else. Ensure a print +statement is returned to say if the number is not negative.
      • +
      +
      x <- 0
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}else{
      +  print("It's not a negative number!")
      +}
      +
      ## [1] "It's not a negative number!"
      +
      x <- -1
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}else{
      +  print("It's not a negative number!")
      +}
      +
      ## [1] "It's a negative number!"
      +
        +
      • Finally add a else if statement. We want a response to confirm if x +is negative, positive or if it is zero.
      • +
      +
      x <- -1
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}else if (x==0){
      +  print("It's zero")
      +}else{
      +  print("It's a positive number!")
      +}
      +
      ## [1] "It's a negative number!"
      +
      x <- 0
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}else if (x==0){
      +  print("It's zero")
      +}else{
      +  print("It's a positive number!")
      +}
      +
      ## [1] "It's zero"
      +
      x <- 1
      +
      +if (x<0){
      +  print("It's a negative number!")
      +}else if (x==0){
      +  print("It's zero")
      +}else{
      +  print("It's a positive number!")
      +}
      +
      ## [1] "It's a positive number!"
      +
        +
      • Build an if/else statement that test if a variable is odd/even. +Include x in the printed output.
      • +
      +

      Hint: The modulus operator may be useful here i.e. x%%2 returns +the remainder after the value of x is divided by 2.

      +
      x <- 1
      +
      +if (x%%2==0){
      +  paste(x,"is even")
      +}else{
      +  paste(x,"is odd")
      +}
      +
      ## [1] "1 is odd"
      +
      x <- 2
      +
      +if (x%%2==0){
      +  paste(x,"is even")
      +}else{
      +  paste(x,"is odd")
      +}
      +
      ## [1] "2 is even"
      +

      – Using an ifelse() expression, create a factor from a vector of 1 to +40 where all numbers less than 10 are “small”,10 to 30 are “mid”,31 to +40 are “big”

      +
      condExercise <- 1:40
      +condExercise
      +
      ##  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
      +## [26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
      +
      vectorResult <- ifelse(condExercise<10,"small",ifelse(condExercise < 31,"mid","big"))
      +temp <- factor(vectorResult,levels=c("small","mid","big"),order=T)
      +temp
      +
      ##  [1] small small small small small small small small small mid   mid   mid  
      +## [13] mid   mid   mid   mid   mid   mid   mid   mid   mid   mid   mid   mid  
      +## [25] mid   mid   mid   mid   mid   mid   big   big   big   big   big   big  
      +## [37] big   big   big   big  
      +## Levels: small < mid < big
      +

      – Calculate the factorial (factorial of 3 = 3 * 2 * 1) of 10 using a +loop.

      +
      for(x in 1:10){
      +  if(x == 1){
      +    factorialAnswer <- 1
      +  }else{
      +    factorialAnswer <- factorialAnswer * x 
      +  }
      +}
      +factorialAnswer
      +
      ## [1] 3628800
      +

      – Adjusting your answer from before, what is the first number that +has a factorial greater than 1000.

      +
      factorialAnswer <- 0
      +count <- 0
      +
      +while(factorialAnswer <= 1000){
      +  count <- count+1
      +  if(count == 1){
      +    factorialAnswer <- 1
      +  }else{
      +    factorialAnswer <- factorialAnswer * count 
      +  }
      +}
      +count
      +
      ## [1] 7
      +
        +
      • Set your working directory to be in the downloaded course material. +Specifically the r_course subdirectory. [The exact path will +depend on where you have save your download]. Read in all files from +expression directory (“ExpressionResults/”) with .txt extension and +create a table of gene expression results.
      • +
      +
      setwd("~/Downloads/Intro_To_R_1Day-master/r_course")
      +
      filesToRead <- dir("ExpressionResults/",pattern = "*\\.txt",full.names=T)
      +fileRead <- vector("list",length=length(filesToRead))
      +
      +for(i in 1:length(filesToRead)){
      +  fileRead[[i]] <- read.delim(filesToRead[i],header=F,sep="\t")
      +  colnames(fileRead[[i]]) <- c("GeneNames",basename(filesToRead[i]))
      +}
      +mergedTable <- NULL
      +for(i in fileRead){
      +  if(is.null(mergedTable)){
      +    mergedTable <- i
      +  }else{
      +    mergedTable <- merge(mergedTable,i,by=1,all=T)
      +  }
      +  
      +  print(nrow(mergedTable))
      +}
      +
      ## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +
      mergedTable[1:3,] 
      +
      ##   GeneNames Annotation.txt          NA ExpressionResults_Sample1.txt
      +## 1  GeneName        Ensembl     Pathway                            NA
      +## 2    Gene_1       Ens_1001 DNA_Binding                      3.448466
      +## 3   Gene_10      Ens_10010 DNA_Binding                      5.314180
      +##   ExpressionResults_Sample10.txt ExpressionResults_Sample2.txt
      +## 1                             NA                            NA
      +## 2                       7.665488                      5.250063
      +## 3                       7.813501                      5.361170
      +##   ExpressionResults_Sample3.txt ExpressionResults_Sample4.txt
      +## 1                            NA                            NA
      +## 2                      5.968927                      6.868251
      +## 3                      5.305980                      6.742855
      +##   ExpressionResults_Sample5.txt ExpressionResults_Sample6.txt
      +## 1                            NA                            NA
      +## 2                      5.367100                      5.189686
      +## 3                      5.957786                      6.293098
      +##   ExpressionResults_Sample7.txt ExpressionResults_Sample8.txt
      +## 1                            NA                            NA
      +## 2                      3.882930                      5.329258
      +## 3                      7.361497                      6.649428
      +##   ExpressionResults_Sample9.txt
      +## 1                            NA
      +## 2                      6.167451
      +## 3                      6.213910
      +

      – Add annotation from Annotation.txt. How do the pathway information +for genes compare between expression table and annotation table.

      +
      Annotation <- read.table("ExpressionResults/Annotation.txt",sep="\t",h=T)
      +annotatedExpression <- merge(Annotation,mergedTable,by=1,all.x=F,all.y=T)
      +annotatedExpression[1:2,]
      +
      ##   GeneName  Ensembl     Pathway Annotation.txt          NA
      +## 1 GeneName     <NA>        <NA>        Ensembl     Pathway
      +## 2   Gene_1 Ens_1001 DNA_Binding       Ens_1001 DNA_Binding
      +##   ExpressionResults_Sample1.txt ExpressionResults_Sample10.txt
      +## 1                            NA                             NA
      +## 2                      3.448466                       7.665488
      +##   ExpressionResults_Sample2.txt ExpressionResults_Sample3.txt
      +## 1                            NA                            NA
      +## 2                      5.250063                      5.968927
      +##   ExpressionResults_Sample4.txt ExpressionResults_Sample5.txt
      +## 1                            NA                            NA
      +## 2                      6.868251                        5.3671
      +##   ExpressionResults_Sample6.txt ExpressionResults_Sample7.txt
      +## 1                            NA                            NA
      +## 2                      5.189686                       3.88293
      +##   ExpressionResults_Sample8.txt ExpressionResults_Sample9.txt
      +## 1                            NA                            NA
      +## 2                      5.329258                      6.167451
      +
      summary(annotatedExpression$Pathway)
      +
      ##    Length     Class      Mode 
      +##      5001 character character
      +
      summary(Annotation$Pathway)
      +
      ##    Length     Class      Mode 
      +##      5000 character character
      + + + + +
      + + + + + + + + + + + + + + + diff --git a/r_course/exercises/answers/FactorsAndDataframes_answers.html b/r_course/exercises/answers/FactorsAndDataframes_answers.html new file mode 100644 index 0000000..3e8db17 --- /dev/null +++ b/r_course/exercises/answers/FactorsAndDataframes_answers.html @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + +Factors and Data frames + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +

      +  +

      +

      These exercises are about the factors and data frames sections of Introduction +to R.

      +

      Exercise 1 - Factors

      +
        +
      • Create a nominal factor called CellType containing: +“DC1”,“DC1”,“DC1”,“NK”,“NK”,“Mono”,“Mono”,“DC2”,“NK”
      • +
      +
      CellType <- factor(c("DC1","DC1","DC1","NK","NK","Mono","Mono","DC2","NK"))
      +CellType
      +
      ## [1] DC1  DC1  DC1  NK   NK   Mono Mono DC2  NK  
      +## Levels: DC1 DC2 Mono NK
      +
        +
      • Modify the the third position of CellType to “Neu”, by modifying the +levels of the factor.
      • +
      +
      levels(CellType) <- c(levels(CellType),"Neu")
      +CellType[3] <- "Neu"
      +CellType
      +
      ## [1] DC1  DC1  Neu  NK   NK   Mono Mono DC2  NK  
      +## Levels: DC1 DC2 Mono NK Neu
      +
        +
      • Create CellType2 with the same entries, but directly specify the +levels to include: “DC1”, “DC2”, “Mono”, “NK”, “Neu”, “Bcell”, +“Tcell”.
      • +
      +
      CellType2 <- factor(c("DC1","DC1","DC1","NK","NK","Mono","Mono","DC2","NK"), levels = c("DC1", "DC2", "Mono", "NK", "Neu", "Bcell", "Tcell"))
      +CellType2
      +
      ## [1] DC1  DC1  DC1  NK   NK   Mono Mono DC2  NK  
      +## Levels: DC1 DC2 Mono NK Neu Bcell Tcell
      +
        +
      • Use combine to increase the length of CellType2 to include: +“Neu”,“Neu”,“Bcell”,“DC1”
      • +
      +
      CellType2 <- c(CellType2, factor(c("Neu","Neu","Bcell","DC1"), levels = c("DC1", "DC2", "Mono", "NK", "Neu", "Bcell", "Tcell")))
      +CellType2
      +
      ##  [1] DC1   DC1   DC1   NK    NK    Mono  Mono  DC2   NK    Neu   Neu   Bcell
      +## [13] DC1  
      +## Levels: DC1 DC2 Mono NK Neu Bcell Tcell
      +
        +
      • Summarize the number of entries for each cell type.
      • +
      +
      summary(CellType2)
      +
      ##   DC1   DC2  Mono    NK   Neu Bcell Tcell 
      +##     4     1     2     3     2     1     0
      +
        +
      • Reorder the summary to alphabetical order
      • +
      +
      levels(CellType2) <- c("Bcell","DC1", "DC2", "Mono", "Neu","NK","Tcell")
      +summary(CellType2)
      +
      ## Bcell   DC1   DC2  Mono   Neu    NK Tcell 
      +##     4     1     2     3     2     1     0
      +
        +
      • Create a ordinal factor named “Height” containing – high, low, mid, +low, mid, low, mid, high, mid, high.
      • +
      +
      Height <- factor(c("high", "low", "mid", "low", "mid", "low", "mid", "high", "mid", "high"),ordered=T,levels=c("low", "mid", "high"))
      +Height
      +
      ##  [1] high low  mid  low  mid  low  mid  high mid  high
      +## Levels: low < mid < high
      +
        +
      • Using a logical index, create new factor of only those from +“Height”” greater than low.
      • +
      +
      filteredHeight <- Height[Height > "low"]
      +filteredHeight
      +
      ## [1] high mid  mid  mid  high mid  high
      +## Levels: low < mid < high
      +
        +
      • Replace the last index in “Height” with veryHigh and create new +factor with those greater than mid.
      • +
      +
      newFactor <- factor(Height,ordered=T,levels=c("low", "mid", "high","veryHigh"))
      +newFactor[length(newFactor)] <- "veryHigh"
      +newFactor[newFactor > "mid"]
      +
      ## [1] high     high     veryHigh
      +## Levels: low < mid < high < veryHigh
      +

      Exercise 2 - Data frames

      +
        +
      • Create data frame called Annotation with a column of gene names +(“Gene_1”, “Gene_2”, “Gene_3”,“Gene_4”,“Gene_5”), ensembl gene names +(“Ens001”, “Ens003”, “Ens006”, “Ens007”, “Ens010”), pathway information +(“Glycolysis”, “TGFb”, “Glycolysis”, “TGFb”, “Glycolysis”) and gene +lengths (100, 3000, 200, 1000,1200).
      • +
      +
      Annotation <- data.frame(geneNames=c("Gene_1", "Gene_2", "Gene_3","Gene_4","Gene_5"), ensembl=c("Ens001", "Ens003", "Ens006", "Ens007", "Ens010"),pathway=c("Glycolysis", "TGFb", "Glycolysis", "TGFb", "Glycolysis"),geneLengths=c(100, 3000, 200, 1000,1200))
      +Annotation
      +
      ##   geneNames ensembl    pathway geneLengths
      +## 1    Gene_1  Ens001 Glycolysis         100
      +## 2    Gene_2  Ens003       TGFb        3000
      +## 3    Gene_3  Ens006 Glycolysis         200
      +## 4    Gene_4  Ens007       TGFb        1000
      +## 5    Gene_5  Ens010 Glycolysis        1200
      +
        +
      • Filter Annotation to geneLengths that are greater than 500 and less +than 2000. Use the dollar sign to extract column information.
      • +
      +
      Annotation[Annotation$geneLengths>500 & Annotation$geneLengths<2000,]
      +
      ##   geneNames ensembl    pathway geneLengths
      +## 4    Gene_4  Ens007       TGFb        1000
      +## 5    Gene_5  Ens010 Glycolysis        1200
      +
        +
      • Check the data types of each column. Update the pathway column to be +a factor.
      • +
      +
      class(Annotation[,1])
      +
      ## [1] "character"
      +
      class(Annotation[,2])
      +
      ## [1] "character"
      +
      class(Annotation[,3])
      +
      ## [1] "character"
      +
      class(Annotation[,4])
      +
      ## [1] "numeric"
      +
      Annotation[,3] <- factor(Annotation[,3])
      +Annotation
      +
      ##   geneNames ensembl    pathway geneLengths
      +## 1    Gene_1  Ens001 Glycolysis         100
      +## 2    Gene_2  Ens003       TGFb        3000
      +## 3    Gene_3  Ens006 Glycolysis         200
      +## 4    Gene_4  Ens007       TGFb        1000
      +## 5    Gene_5  Ens010 Glycolysis        1200
      +
      class(Annotation[,3])
      +
      ## [1] "factor"
      +
        +
      • Create data frame called Sample1 with ensembl gene names (“Ens001”, +“Ens003”, “Ens006”, “Ens010”) and expression (1000, 3000, +10000,5000)
      • +
      +
      Sample1 <- data.frame(ensembl=c("Ens001", "Ens003", "Ens006","Ens010"),expression=c(1000, 3000, 10000,5000))
      +Sample1
      +
      ##   ensembl expression
      +## 1  Ens001       1000
      +## 2  Ens003       3000
      +## 3  Ens006      10000
      +## 4  Ens010       5000
      +
        +
      • Create data frame called Sample2 with ensembl gene names (“Ens001”, +“Ens003”, “Ens006”, “Ens007”,“Ens010”) and expression (1500, 1500, +17000,500,10000)
      • +
      +
      Sample2 <- data.frame(ensembl=c("Ens001", "Ens003", "Ens006","Ens007","Ens010"),expression=c(1500, 1500, 17000,500,10000))
      +Sample2
      +
      ##   ensembl expression
      +## 1  Ens001       1500
      +## 2  Ens003       1500
      +## 3  Ens006      17000
      +## 4  Ens007        500
      +## 5  Ens010      10000
      +
        +
      • Create a data frame containing only those gene names common to all +data frames with all information from Annotation and the expression from +Sample 1 and Sample 2.
      • +
      +
      AnnoSample1 <- merge(Annotation,Sample1,by.x=2,by.y=1,all=F) 
      +AnnoSample1And2 <- merge(AnnoSample1,Sample2,by=1,all=F) 
      +AnnoSample1And2
      +
      ##   ensembl geneNames    pathway geneLengths expression.x expression.y
      +## 1  Ens001    Gene_1 Glycolysis         100         1000         1500
      +## 2  Ens003    Gene_2       TGFb        3000         3000         1500
      +## 3  Ens006    Gene_3 Glycolysis         200        10000        17000
      +## 4  Ens010    Gene_5 Glycolysis        1200         5000        10000
      +
        +
      • Order our new dataframe by geneLengths - biggest to smallest.
      • +
      +
      AnnoSample1And2 <- AnnoSample1And2[order(AnnoSample1And2$geneLengths, decreasing = T),]
      +AnnoSample1And2
      +
      ##   ensembl geneNames    pathway geneLengths expression.x expression.y
      +## 2  Ens003    Gene_2       TGFb        3000         3000         1500
      +## 4  Ens010    Gene_5 Glycolysis        1200         5000        10000
      +## 3  Ens006    Gene_3 Glycolysis         200        10000        17000
      +## 1  Ens001    Gene_1 Glycolysis         100         1000         1500
      +
        +
      • Add an extra two columns containing the length normalized +expressions for Sample 1 and Sample 2
      • +
      +
      AnnoSample1And2$Sample1_lne <- AnnoSample1And2$expression.x/AnnoSample1And2$geneLengths
      +AnnoSample1And2$Sample2_lne <- AnnoSample1And2$expression.y/AnnoSample1And2$geneLengths
      +AnnoSample1And2
      +
      ##   ensembl geneNames    pathway geneLengths expression.x expression.y
      +## 2  Ens003    Gene_2       TGFb        3000         3000         1500
      +## 4  Ens010    Gene_5 Glycolysis        1200         5000        10000
      +## 3  Ens006    Gene_3 Glycolysis         200        10000        17000
      +## 1  Ens001    Gene_1 Glycolysis         100         1000         1500
      +##   Sample1_lne Sample2_lne
      +## 2    1.000000    0.500000
      +## 4    4.166667    8.333333
      +## 3   50.000000   85.000000
      +## 1   10.000000   15.000000
      +
        +
      • Identify the mean length normalized expression across Sample1 and +Sample2 for Ens006 genes
      • +
      +
      rownames(AnnoSample1And2) <- AnnoSample1And2$ensembl
      +mean(c(AnnoSample1And2["Ens006","Sample1_lne"],AnnoSample1And2["Ens006","Sample2_lne"]))
      +
      ## [1] 67.5
      +
        +
      • For all genes, identify the log2 fold change in length normalized +expression from Sample 1 to Sample 2.
      • +
      +
      log2FoldChange <- log2(AnnoSample1And2$Sample2_lne) - log2(AnnoSample1And2$Sample1_lne)
      +names(log2FoldChange) <- AnnoSample1And2$geneNames
      +log2FoldChange
      +
      ##     Gene_2     Gene_5     Gene_3     Gene_1 
      +## -1.0000000  1.0000000  0.7655347  0.5849625
      +
        +
      • Identify the total length of genes in Glycolysis pathway.
      • +
      +
      sum(AnnoSample1And2[AnnoSample1And2$pathway == "Glycolysis","geneLengths"])
      +
      ## [1] 1500
      + + + + +
      + + + + + + + + + + + + + + + diff --git a/r_course/exercises/answers/Matrices_answers.html b/r_course/exercises/answers/Matrices_answers.html new file mode 100644 index 0000000..c9b6785 --- /dev/null +++ b/r_course/exercises/answers/Matrices_answers.html @@ -0,0 +1,592 @@ + + + + + + + + + + + + + + +Matrices + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +

      +  +

      +

      These exercises are about the matrices sections of Introduction +to R.

      +

      Exercise 1

      +
        +
      • Create a matrix containing information on gene names Gene_1, Gene_2, +Gene_3,Gene_4 expression values 1000, 3000, 10000, 12000 and gene +lengths 100, 3000, 200, 1000
      • +
      +
      geneNames <- c("Gene_1", "Gene_2", "Gene_3","Gene_4")
      +expression <- c(1000, 3000, 10000, 12000)
      +geneLengths <- c(100, 3000, 200, 1000)
      +geneMatrix <- cbind(expression,geneLengths)
      +rownames(geneMatrix) <- geneNames
      +geneMatrix
      +
      ##        expression geneLengths
      +## Gene_1       1000         100
      +## Gene_2       3000        3000
      +## Gene_3      10000         200
      +## Gene_4      12000        1000
      +
        +
      • Update the matrix to contain the expression over the gene length for +all genes (Length normalised expression) as final column. +
      • +
      +

      HINT - We calculated LNE before in vectors exercises’ bonus +question

      +
      lne <- geneMatrix[,"expression"]/geneMatrix[,"geneLengths"]
      +geneMatrix <- cbind(geneMatrix,lne)
      +geneMatrix
      +
      ##        expression geneLengths lne
      +## Gene_1       1000         100  10
      +## Gene_2       3000        3000   1
      +## Gene_3      10000         200  50
      +## Gene_4      12000        1000  12
      +
        +
      • Create a smaller matrix containing genes longer than 200
      • +
      +
      smallGeneMatrix <- geneMatrix[geneMatrix[,"geneLengths"] > 200,]
      +smallGeneMatrix
      +
      ##        expression geneLengths lne
      +## Gene_2       3000        3000   1
      +## Gene_4      12000        1000  12
      +
        +
      • Create a smaller matrix with just expression and lne columns +containing genes longer than 200 and expression greater than 300.
      • +
      +
      smallGeneMatrix <- geneMatrix[geneMatrix[,"geneLengths"] > 200 & geneMatrix[,"expression"] > 300,c("expression","lne")]
      +smallGeneMatrix
      +
      ##        expression lne
      +## Gene_2       3000   1
      +## Gene_4      12000  12
      +
        +
      • Add an additional column to the orginal matrix which contains some +GO terms associated with these genes: “Positively Regulates +Transcription”, “Negatively Regulates Transcription”, “Positively +Regulates Transcription”, “Regulates Autophagy”
      • +
      +
      GOterms <- c("Positively Regulates Transcription", "Negatively Regulates Transcription", "Positively Regulates Transcription", "Regulates Autophagy")
      +geneMatrix_GO <- cbind(geneMatrix,GOterms)
      +geneMatrix_GO
      +
      ##        expression geneLengths lne  GOterms                             
      +## Gene_1 "1000"     "100"       "10" "Positively Regulates Transcription"
      +## Gene_2 "3000"     "3000"      "1"  "Negatively Regulates Transcription"
      +## Gene_3 "10000"    "200"       "50" "Positively Regulates Transcription"
      +## Gene_4 "12000"    "1000"      "12" "Regulates Autophagy"
      +
        +
      • What is the data type? Use the class(),is.numeric() and +is.character() functions to investigate. Compare this to the original +matrix.
      • +
      +
      class(geneMatrix_GO)
      +
      ## [1] "matrix" "array"
      +
      is.numeric(geneMatrix_GO)
      +
      ## [1] FALSE
      +
      is.character(geneMatrix_GO)
      +
      ## [1] TRUE
      +
      class(geneMatrix)
      +
      ## [1] "matrix" "array"
      +
      is.numeric(geneMatrix)
      +
      ## [1] TRUE
      +
      is.character(geneMatrix)
      +
      ## [1] FALSE
      +
        +
      • Subset the original matrix to only genes that are involved in +Transcription. Make sure the result is a numeric matrix.
      • +
      +
      geneMatrix_transcription <- geneMatrix[grepl("transcription",GOterms, ignore.case = T),]
      +
      +geneMatrix_transcription
      +
      ##        expression geneLengths lne
      +## Gene_1       1000         100  10
      +## Gene_2       3000        3000   1
      +## Gene_3      10000         200  50
      +
      is.numeric(geneMatrix_transcription)
      +
      ## [1] TRUE
      +

      Bonus Question

      +

      - Calculate the sum of expression and length +columns for only genes with length > 100.

      +
      expressionSum <- sum(geneMatrix[geneMatrix[,"geneLengths"] > 100,"expression"])
      +geneLengthSum <- sum(geneMatrix[geneMatrix[,"geneLengths"] > 100,"geneLengths"])
      +#OR
      +expressionAndGeneLengthSum <- colSums(geneMatrix[geneMatrix[,"geneLengths"] > 100,c("expression","geneLengths")])
      +expressionAndGeneLengthSum
      +
      ##  expression geneLengths 
      +##       25000        4200
      + + + + +
      + + + + + + + + + + + + + + + diff --git a/r_course/exercises/exercises/ConditionsAndLoops_exercise.html b/r_course/exercises/exercises/ConditionsAndLoops_exercise.html new file mode 100644 index 0000000..eddba83 --- /dev/null +++ b/r_course/exercises/exercises/ConditionsAndLoops_exercise.html @@ -0,0 +1,499 @@ + + + + + + + + + + + + + + +Conditional branching and looping in R + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +

      +  +

      +

      These exercises are about the conditions and loops sections of Introduction +to R.

      +

      Exercise 1 - If Else

      +
        +
      • Build an if statement that test if x is a negative number. Write a +print statement that will confirm if x is less than 0. Test it with +several values of x.
      • +
      +
      ## [1] "It's a negative number!"
      +
        +
      • Modify the previous if statement to include an else. Ensure a print +statement is returned to say if the number is not negative.
      • +
      +
      ## [1] "It's not a negative number!"
      +
      ## [1] "It's a negative number!"
      +
        +
      • Finally add a else if statement. We want a response to confirm if x +is negative, positive or if it is zero.
      • +
      +
      ## [1] "It's a negative number!"
      +
      ## [1] "It's zero"
      +
      ## [1] "It's a positive number!"
      +
        +
      • Build an if/else statement that test if a variable is odd/even. +Include x in the printed output.
      • +
      +

      Hint: The modulus operator may be useful here i.e. x%%2 returns +the remainder after the value of x is divided by 2.

      +
      ## [1] "1 is odd"
      +
      ## [1] "2 is even"
      +

      – Using an ifelse() expression, create a factor from a vector of 1 to +40 where all numbers less than 10 are “small”,10 to 30 are “mid”,31 to +40 are “big”

      +
      ##  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
      +## [26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
      +
      ##  [1] small small small small small small small small small mid   mid   mid  
      +## [13] mid   mid   mid   mid   mid   mid   mid   mid   mid   mid   mid   mid  
      +## [25] mid   mid   mid   mid   mid   mid   big   big   big   big   big   big  
      +## [37] big   big   big   big  
      +## Levels: small < mid < big
      +

      – Calculate the factorial (factorial of 3 = 3 * 2 * 1) of 10 using a +loop.

      +
      ## [1] 3628800
      +

      – Adjusting your answer from before, what is the first number that +has a factorial greater than 1000.

      +
      ## [1] 7
      +
        +
      • Set your working directory to be in the downloaded course material. +Specifically the r_course subdirectory. [The exact path will +depend on where you have save your download]. Read in all files from +expression directory (“ExpressionResults/”) with .txt extension and +create a table of gene expression results.
      • +
      +
      ## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +## [1] 5001
      +
      ##   GeneNames Annotation.txt          NA ExpressionResults_Sample1.txt
      +## 1  GeneName        Ensembl     Pathway                            NA
      +## 2    Gene_1       Ens_1001 DNA_Binding                      3.448466
      +## 3   Gene_10      Ens_10010 DNA_Binding                      5.314180
      +##   ExpressionResults_Sample10.txt ExpressionResults_Sample2.txt
      +## 1                             NA                            NA
      +## 2                       7.665488                      5.250063
      +## 3                       7.813501                      5.361170
      +##   ExpressionResults_Sample3.txt ExpressionResults_Sample4.txt
      +## 1                            NA                            NA
      +## 2                      5.968927                      6.868251
      +## 3                      5.305980                      6.742855
      +##   ExpressionResults_Sample5.txt ExpressionResults_Sample6.txt
      +## 1                            NA                            NA
      +## 2                      5.367100                      5.189686
      +## 3                      5.957786                      6.293098
      +##   ExpressionResults_Sample7.txt ExpressionResults_Sample8.txt
      +## 1                            NA                            NA
      +## 2                      3.882930                      5.329258
      +## 3                      7.361497                      6.649428
      +##   ExpressionResults_Sample9.txt
      +## 1                            NA
      +## 2                      6.167451
      +## 3                      6.213910
      +

      – Add annotation from Annotation.txt. How do the pathway information +for genes compare between expression table and annotation table.

      +
      ##   GeneName  Ensembl     Pathway Annotation.txt          NA
      +## 1 GeneName     <NA>        <NA>        Ensembl     Pathway
      +## 2   Gene_1 Ens_1001 DNA_Binding       Ens_1001 DNA_Binding
      +##   ExpressionResults_Sample1.txt ExpressionResults_Sample10.txt
      +## 1                            NA                             NA
      +## 2                      3.448466                       7.665488
      +##   ExpressionResults_Sample2.txt ExpressionResults_Sample3.txt
      +## 1                            NA                            NA
      +## 2                      5.250063                      5.968927
      +##   ExpressionResults_Sample4.txt ExpressionResults_Sample5.txt
      +## 1                            NA                            NA
      +## 2                      6.868251                        5.3671
      +##   ExpressionResults_Sample6.txt ExpressionResults_Sample7.txt
      +## 1                            NA                            NA
      +## 2                      5.189686                       3.88293
      +##   ExpressionResults_Sample8.txt ExpressionResults_Sample9.txt
      +## 1                            NA                            NA
      +## 2                      5.329258                      6.167451
      +
      ##    Length     Class      Mode 
      +##      5001 character character
      +
      ##    Length     Class      Mode 
      +##      5000 character character
      + + + + +
      + + + + + + + + + + + + + + + diff --git a/r_course/exercises/exercises/FactorsAndDataframes_exercise.html b/r_course/exercises/exercises/FactorsAndDataframes_exercise.html new file mode 100644 index 0000000..ec7ae52 --- /dev/null +++ b/r_course/exercises/exercises/FactorsAndDataframes_exercise.html @@ -0,0 +1,651 @@ + + + + + + + + + + + + + + +Factors and Data frames + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +

      +  +

      +

      These exercises are about the factors and data frames sections of Introduction +to R.

      +

      Exercise 1 - Factors

      +
        +
      • Create a nominal factor called CellType containing: +“DC1”,“DC1”,“DC1”,“NK”,“NK”,“Mono”,“Mono”,“DC2”,“NK”
      • +
      +
      ## [1] DC1  DC1  DC1  NK   NK   Mono Mono DC2  NK  
      +## Levels: DC1 DC2 Mono NK
      +
        +
      • Modify the the third position of CellType to “Neu”, by modifying the +levels of the factor.
      • +
      +
      ## [1] DC1  DC1  Neu  NK   NK   Mono Mono DC2  NK  
      +## Levels: DC1 DC2 Mono NK Neu
      +
        +
      • Create CellType2 with the same entries, but directly specify the +levels to include: “DC1”, “DC2”, “Mono”, “NK”, “Neu”, “Bcell”, +“Tcell”.
      • +
      +
      ## [1] DC1  DC1  DC1  NK   NK   Mono Mono DC2  NK  
      +## Levels: DC1 DC2 Mono NK Neu Bcell Tcell
      +
        +
      • Use combine to increase the length of CellType2 to include: +“Neu”,“Neu”,“Bcell”,“DC1”
      • +
      +
      ##  [1] DC1   DC1   DC1   NK    NK    Mono  Mono  DC2   NK    Neu   Neu   Bcell
      +## [13] DC1  
      +## Levels: DC1 DC2 Mono NK Neu Bcell Tcell
      +
        +
      • Summarize the number of entries for each cell type.
      • +
      +
      summary(CellType2)
      +
      ##   DC1   DC2  Mono    NK   Neu Bcell Tcell 
      +##     4     1     2     3     2     1     0
      +
        +
      • Reorder the summary to alphabetical order
      • +
      +
      levels(CellType2) <- c("Bcell","DC1", "DC2", "Mono", "Neu","NK","Tcell")
      +summary(CellType2)
      +
      ## Bcell   DC1   DC2  Mono   Neu    NK Tcell 
      +##     4     1     2     3     2     1     0
      +
        +
      • Create a ordinal factor named “Height” containing – high, low, mid, +low, mid, low, mid, high, mid, high.
      • +
      +
      ##  [1] high low  mid  low  mid  low  mid  high mid  high
      +## Levels: low < mid < high
      +
        +
      • Using a logical index, create new factor of only those from +“Height”” greater than low.
      • +
      +
      ## [1] high mid  mid  mid  high mid  high
      +## Levels: low < mid < high
      +
        +
      • Replace the last index in “Height” with veryHigh and create new +factor with those greater than mid.
      • +
      +
      ## [1] high     high     veryHigh
      +## Levels: low < mid < high < veryHigh
      +

      Exercise 2 - Data frames

      +
        +
      • Create data frame called Annotation with a column of gene names +(“Gene_1”, “Gene_2”, “Gene_3”,“Gene_4”,“Gene_5”), ensembl gene names +(“Ens001”, “Ens003”, “Ens006”, “Ens007”, “Ens010”), pathway information +(“Glycolysis”, “TGFb”, “Glycolysis”, “TGFb”, “Glycolysis”) and gene +lengths (100, 3000, 200, 1000,1200).
      • +
      +
      ##   geneNames ensembl    pathway geneLengths
      +## 1    Gene_1  Ens001 Glycolysis         100
      +## 2    Gene_2  Ens003       TGFb        3000
      +## 3    Gene_3  Ens006 Glycolysis         200
      +## 4    Gene_4  Ens007       TGFb        1000
      +## 5    Gene_5  Ens010 Glycolysis        1200
      +
        +
      • Filter Annotation to geneLengths that are greater than 500 and less +than 2000. Use the dollar sign to extract column information.
      • +
      +
      ##   geneNames ensembl    pathway geneLengths
      +## 4    Gene_4  Ens007       TGFb        1000
      +## 5    Gene_5  Ens010 Glycolysis        1200
      +
        +
      • Check the data types of each column. Update the pathway column to be +a factor.
      • +
      +
      ## [1] "character"
      +
      ## [1] "character"
      +
      ## [1] "character"
      +
      ## [1] "numeric"
      +
      ##   geneNames ensembl    pathway geneLengths
      +## 1    Gene_1  Ens001 Glycolysis         100
      +## 2    Gene_2  Ens003       TGFb        3000
      +## 3    Gene_3  Ens006 Glycolysis         200
      +## 4    Gene_4  Ens007       TGFb        1000
      +## 5    Gene_5  Ens010 Glycolysis        1200
      +
      ## [1] "factor"
      +
        +
      • Create data frame called Sample1 with ensembl gene names (“Ens001”, +“Ens003”, “Ens006”, “Ens010”) and expression (1000, 3000, +10000,5000)
      • +
      +
      ##   ensembl expression
      +## 1  Ens001       1000
      +## 2  Ens003       3000
      +## 3  Ens006      10000
      +## 4  Ens010       5000
      +
        +
      • Create data frame called Sample2 with ensembl gene names (“Ens001”, +“Ens003”, “Ens006”, “Ens007”,“Ens010”) and expression (1500, 1500, +17000,500,10000)
      • +
      +
      ##   ensembl expression
      +## 1  Ens001       1500
      +## 2  Ens003       1500
      +## 3  Ens006      17000
      +## 4  Ens007        500
      +## 5  Ens010      10000
      +
        +
      • Create a data frame containing only those gene names common to all +data frames with all information from Annotation and the expression from +Sample 1 and Sample 2.
      • +
      +
      ##   ensembl geneNames    pathway geneLengths expression.x expression.y
      +## 1  Ens001    Gene_1 Glycolysis         100         1000         1500
      +## 2  Ens003    Gene_2       TGFb        3000         3000         1500
      +## 3  Ens006    Gene_3 Glycolysis         200        10000        17000
      +## 4  Ens010    Gene_5 Glycolysis        1200         5000        10000
      +
        +
      • Order our new dataframe by geneLengths - biggest to smallest.
      • +
      +
      ##   ensembl geneNames    pathway geneLengths expression.x expression.y
      +## 2  Ens003    Gene_2       TGFb        3000         3000         1500
      +## 4  Ens010    Gene_5 Glycolysis        1200         5000        10000
      +## 3  Ens006    Gene_3 Glycolysis         200        10000        17000
      +## 1  Ens001    Gene_1 Glycolysis         100         1000         1500
      +
        +
      • Add an extra two columns containing the length normalized +expressions for Sample 1 and Sample 2
      • +
      +
      ##   ensembl geneNames    pathway geneLengths expression.x expression.y
      +## 2  Ens003    Gene_2       TGFb        3000         3000         1500
      +## 4  Ens010    Gene_5 Glycolysis        1200         5000        10000
      +## 3  Ens006    Gene_3 Glycolysis         200        10000        17000
      +## 1  Ens001    Gene_1 Glycolysis         100         1000         1500
      +##   Sample1_lne Sample2_lne
      +## 2    1.000000    0.500000
      +## 4    4.166667    8.333333
      +## 3   50.000000   85.000000
      +## 1   10.000000   15.000000
      +
        +
      • Identify the mean length normalized expression across Sample1 and +Sample2 for Ens006 genes
      • +
      +
      ## [1] 67.5
      +
        +
      • For all genes, identify the log2 fold change in length normalized +expression from Sample 1 to Sample 2.
      • +
      +
      ##     Gene_2     Gene_5     Gene_3     Gene_1 
      +## -1.0000000  1.0000000  0.7655347  0.5849625
      +
        +
      • Identify the total length of genes in Glycolysis pathway.
      • +
      +
      ## [1] 1500
      + + + + +
      + + + + + + + + + + + + + + + diff --git a/r_course/exercises/exercises/Matrices_exercise.html b/r_course/exercises/exercises/Matrices_exercise.html new file mode 100644 index 0000000..8011841 --- /dev/null +++ b/r_course/exercises/exercises/Matrices_exercise.html @@ -0,0 +1,571 @@ + + + + + + + + + + + + + + +Matrices + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +

      +  +

      +

      These exercises are about the matrices sections of Introduction +to R.

      +

      Exercise 1

      +
        +
      • Create a matrix containing information on gene names Gene_1, Gene_2, +Gene_3,Gene_4 expression values 1000, 3000, 10000, 12000 and gene +lengths 100, 3000, 200, 1000
      • +
      +
      ##        expression geneLengths
      +## Gene_1       1000         100
      +## Gene_2       3000        3000
      +## Gene_3      10000         200
      +## Gene_4      12000        1000
      +
        +
      • Update the matrix to contain the expression over the gene length for +all genes (Length normalised expression) as final column. +
      • +
      +

      HINT - We calculated LNE before in vectors exercises’ bonus +question

      +
      ##        expression geneLengths lne
      +## Gene_1       1000         100  10
      +## Gene_2       3000        3000   1
      +## Gene_3      10000         200  50
      +## Gene_4      12000        1000  12
      +
        +
      • Create a smaller matrix containing genes longer than 200
      • +
      +
      ##        expression geneLengths lne
      +## Gene_2       3000        3000   1
      +## Gene_4      12000        1000  12
      +
        +
      • Create a smaller matrix with just expression and lne columns +containing genes longer than 200 and expression greater than 300.
      • +
      +
      ##        expression lne
      +## Gene_2       3000   1
      +## Gene_4      12000  12
      +
        +
      • Add an additional column to the orginal matrix which contains some +GO terms associated with these genes: “Positively Regulates +Transcription”, “Negatively Regulates Transcription”, “Positively +Regulates Transcription”, “Regulates Autophagy”
      • +
      +
      ##        expression geneLengths lne  GOterms                             
      +## Gene_1 "1000"     "100"       "10" "Positively Regulates Transcription"
      +## Gene_2 "3000"     "3000"      "1"  "Negatively Regulates Transcription"
      +## Gene_3 "10000"    "200"       "50" "Positively Regulates Transcription"
      +## Gene_4 "12000"    "1000"      "12" "Regulates Autophagy"
      +
        +
      • What is the data type? Use the class(),is.numeric() and +is.character() functions to investigate. Compare this to the original +matrix.
      • +
      +
      class(geneMatrix_GO)
      +
      ## [1] "matrix" "array"
      +
      is.numeric(geneMatrix_GO)
      +
      ## [1] FALSE
      +
      is.character(geneMatrix_GO)
      +
      ## [1] TRUE
      +
      class(geneMatrix)
      +
      ## [1] "matrix" "array"
      +
      is.numeric(geneMatrix)
      +
      ## [1] TRUE
      +
      is.character(geneMatrix)
      +
      ## [1] FALSE
      +
        +
      • Subset the original matrix to only genes that are involved in +Transcription. Make sure the result is a numeric matrix.
      • +
      +
      geneMatrix_transcription <- geneMatrix[grepl("transcription",GOterms, ignore.case = T),]
      +
      +geneMatrix_transcription
      +
      ##        expression geneLengths lne
      +## Gene_1       1000         100  10
      +## Gene_2       3000        3000   1
      +## Gene_3      10000         200  50
      +
      is.numeric(geneMatrix_transcription)
      +
      ## [1] TRUE
      +

      Bonus Question

      +

      - Calculate the sum of expression and length +columns for only genes with length > 100.

      +
      ##  expression geneLengths 
      +##       25000        4200
      + + + + +
      + + + + + + + + + + + + + + + diff --git a/r_course/presentations/singlepage/introToR_Session1.html b/r_course/presentations/singlepage/introToR_Session1.html index 1448a2d..6b9a2a6 100644 --- a/r_course/presentations/singlepage/introToR_Session1.html +++ b/r_course/presentations/singlepage/introToR_Session1.html @@ -3082,7 +3082,7 @@

      More complex objects

      manage Dates or Times.

      Time <- Sys.time()
       Time
      -
      ## [1] "2024-12-12 02:00:20 UTC"
      +
      ## [1] "2024-12-12 18:12:15 UTC"

      More complex objects

      @@ -3110,11 +3110,11 @@

      More complex objects

      More complex objects

      We can also use the arithmetic operations with our time objects.

      Time
      -
      ## [1] "2024-12-12 02:00:20 UTC"
      +
      ## [1] "2024-12-12 18:12:15 UTC"
      Time - 120
      -
      ## [1] "2024-12-12 01:58:20 UTC"
      +
      ## [1] "2024-12-12 18:10:15 UTC"
      TimeNow - Time
      -
      ## Time difference of 0.1078458 secs
      +
      ## Time difference of 0.1084907 secs

      More complex objects

      @@ -3125,18 +3125,18 @@

      More complex objects

      We can also change the timezone by specifying a tz parameter

      format(Time,format="%H O'Clock %p %A on %B %dth")
      -
      ## [1] "02 O'Clock AM Thursday on December 12th"
      +
      ## [1] "18 O'Clock PM Thursday on December 12th"
      format(Time,format="%H O'Clock %p %A on %B %dth",tz = "GMT")
      -
      ## [1] "02 O'Clock AM Thursday on December 12th"
      +
      ## [1] "18 O'Clock PM Thursday on December 12th"

      Complex to base objects

      Most of the time we can convert more complex object back to our basic object types we are more familar with.

      as.character(Time)
      -
      ## [1] "2024-12-12 02:00:20.799085"
      +
      ## [1] "2024-12-12 18:12:15.725485"
      as.numeric(TimeNow-Time)
      -
      ## [1] 0.1078458
      +
      ## [1] 0.1084907

      Complex objects summary

      @@ -3245,13 +3245,13 @@

      Data from external sources

      Gene_a -3.362639 +3.567960 -3.523646 +3.751809 -4.704296 +5.156441 @@ -3259,13 +3259,13 @@

      Data from external sources

      Gene_b -2.768784 +3.969382 -2.772147 +2.563824 -4.844562 +4.743562 @@ -3273,13 +3273,13 @@

      Data from external sources

      Gene_c -5.078882 +4.874842 -3.713159 +5.002982 -6.027094 +4.089564 @@ -3287,13 +3287,13 @@

      Data from external sources

      Gene_d -3.706215 +4.319586 -4.482517 +3.346743 -4.814330 +4.855645 @@ -3301,13 +3301,13 @@

      Data from external sources

      Gene_e -10.442474 +9.767292 -10.785325 +8.984913 -8.939309 +9.525845 @@ -3315,13 +3315,13 @@

      Data from external sources

      Gene_f -9.620548 +11.038205 -10.042143 +10.778420 -10.399179 +10.270429 @@ -3329,13 +3329,13 @@

      Data from external sources

      Gene_g -10.155296 +8.517023 -9.964465 +11.603366 -9.048469 +7.418904 @@ -3343,13 +3343,13 @@

      Data from external sources

      Gene_h -10.082693 +9.140641 -12.054921 +9.419702 -10.230600 +10.145435 diff --git a/r_course/presentations/singlepage/introToR_Session2.html b/r_course/presentations/singlepage/introToR_Session2.html index 7d1dd2c..481de52 100644 --- a/r_course/presentations/singlepage/introToR_Session2.html +++ b/r_course/presentations/singlepage/introToR_Session2.html @@ -2390,8 +2390,8 @@

      Custom function example

      A <- rnorm(20) my_zscore(my_number=A[1], my_vector=A)
      -
      ## Mean is -0.0473813821205204
      -
      ## [1] 2.066187
      +
      ## Mean is 0.260665894154018
      +
      ## [1] -0.2426098

      Debugging functions

      @@ -2406,10 +2406,10 @@

      Debugging functions

      Custom functions and apply

      These custom functions can also be utilized with apply.

      sapply(A, my_zscore, my_vector=A)
      -
      ##  [1]  2.06618698  0.17165772 -0.71309305  0.04463075 -1.24264432  0.21368949
      -##  [7] -0.82084457  0.89006732 -0.57284618 -0.46639582 -1.28333645  0.98048258
      -## [13]  1.31683429 -0.36486729 -0.02032230 -0.68673550  0.13403087  1.02971875
      -## [19]  1.13413397 -1.81034725
      +
      ##  [1] -0.24260979  0.37093999  0.58712023  0.81503665  0.92783453  0.54524311
      +##  [7] -1.15824154 -0.38544962  0.08283829  0.73612828 -1.39531982 -0.48690779
      +## [13] -2.08700758  1.41872341 -0.02320079  0.08587476  1.50147491 -1.67344992
      +## [19]  0.86495743 -0.48398475
      diff --git a/r_course/presentations/slides/introToR_Session1.html b/r_course/presentations/slides/introToR_Session1.html index bd32505..a0a8e0c 100644 --- a/r_course/presentations/slides/introToR_Session1.html +++ b/r_course/presentations/slides/introToR_Session1.html @@ -2722,7 +2722,7 @@ ``` ``` -## [1] "2024-12-12 02:00:18 UTC" +## [1] "2024-12-12 18:12:13 UTC" ``` --- @@ -2777,7 +2777,7 @@ ``` ``` -## [1] "2024-12-12 02:00:18 UTC" +## [1] "2024-12-12 18:12:13 UTC" ``` ``` r @@ -2785,7 +2785,7 @@ ``` ``` -## [1] "2024-12-12 01:58:18 UTC" +## [1] "2024-12-12 18:10:13 UTC" ``` ``` r @@ -2793,7 +2793,7 @@ ``` ``` -## Time difference of 0.1020856 secs +## Time difference of 0.1018271 secs ``` --- @@ -2811,7 +2811,7 @@ ``` ``` -## [1] "02 O'Clock AM Thursday on December 12th" +## [1] "18 O'Clock PM Thursday on December 12th" ``` ``` r @@ -2819,7 +2819,7 @@ ``` ``` -## [1] "02 O'Clock AM Thursday on December 12th" +## [1] "18 O'Clock PM Thursday on December 12th" ``` --- @@ -2833,7 +2833,7 @@ ``` ``` -## [1] "2024-12-12 02:00:18.932222" +## [1] "2024-12-12 18:12:13.836075" ``` ``` r @@ -2841,7 +2841,7 @@ ``` ``` -## [1] 0.1020856 +## [1] 0.1018271 ``` --- @@ -2958,51 +2958,51 @@ <tbody> <tr> <td style="text-align:left;"> Gene_a </td> - <td style="text-align:right;"> 4.474330 </td> - <td style="text-align:right;"> 3.317462 </td> - <td style="text-align:right;"> 4.099006 </td> + <td style="text-align:right;"> 3.610115 </td> + <td style="text-align:right;"> 4.853242 </td> + <td style="text-align:right;"> 3.282902 </td> </tr> <tr> <td style="text-align:left;"> Gene_b </td> - <td style="text-align:right;"> 4.981917 </td> - <td style="text-align:right;"> 2.944475 </td> - <td style="text-align:right;"> 4.085144 </td> + <td style="text-align:right;"> 3.993367 </td> + <td style="text-align:right;"> 4.172051 </td> + <td style="text-align:right;"> 4.435115 </td> </tr> <tr> <td style="text-align:left;"> Gene_c </td> - <td style="text-align:right;"> 4.134901 </td> - <td style="text-align:right;"> 2.906727 </td> - <td style="text-align:right;"> 3.657244 </td> + <td style="text-align:right;"> 2.771158 </td> + <td style="text-align:right;"> 3.838969 </td> + <td style="text-align:right;"> 5.041786 </td> </tr> <tr> <td style="text-align:left;"> Gene_d </td> - <td style="text-align:right;"> 4.060022 </td> - <td style="text-align:right;"> 3.431809 </td> - <td style="text-align:right;"> 3.067610 </td> + <td style="text-align:right;"> 4.215114 </td> + <td style="text-align:right;"> 3.588607 </td> + <td style="text-align:right;"> 5.006741 </td> </tr> <tr> <td style="text-align:left;"> Gene_e </td> - <td style="text-align:right;"> 8.375376 </td> - <td style="text-align:right;"> 11.302259 </td> - <td style="text-align:right;"> 9.741597 </td> + <td style="text-align:right;"> 9.374658 </td> + <td style="text-align:right;"> 12.053861 </td> + <td style="text-align:right;"> 10.350153 </td> </tr> <tr> <td style="text-align:left;"> Gene_f </td> - <td style="text-align:right;"> 10.681901 </td> - <td style="text-align:right;"> 8.988139 </td> - <td style="text-align:right;"> 9.882073 </td> + <td style="text-align:right;"> 10.352955 </td> + <td style="text-align:right;"> 9.145474 </td> + <td style="text-align:right;"> 9.897497 </td> </tr> <tr> <td style="text-align:left;"> Gene_g </td> - <td style="text-align:right;"> 8.381877 </td> - <td style="text-align:right;"> 10.246497 </td> - <td style="text-align:right;"> 9.182067 </td> + <td style="text-align:right;"> 11.078091 </td> + <td style="text-align:right;"> 10.386456 </td> + <td style="text-align:right;"> 7.507547 </td> </tr> <tr> <td style="text-align:left;"> Gene_h </td> - <td style="text-align:right;"> 10.374626 </td> - <td style="text-align:right;"> 10.020247 </td> - <td style="text-align:right;"> 9.315545 </td> + <td style="text-align:right;"> 10.949266 </td> + <td style="text-align:right;"> 8.658287 </td> + <td style="text-align:right;"> 9.715341 </td> </tr> </tbody> </table> diff --git a/r_course/presentations/slides/introToR_Session2.html b/r_course/presentations/slides/introToR_Session2.html index 5aa9154..c6e0540 100644 --- a/r_course/presentations/slides/introToR_Session2.html +++ b/r_course/presentations/slides/introToR_Session2.html @@ -1388,11 +1388,11 @@ ``` ``` -## Mean is -0.0285571678374593 +## Mean is 0.212886120819524 ``` ``` -## [1] 0.02294925 +## [1] -0.1614368 ``` --- @@ -1417,10 +1417,10 @@ ``` ``` -## [1] 0.02294925 -0.37163355 -2.39999644 -0.16341592 -0.18844930 0.10238615 -## [7] 0.14811348 -0.55440560 -0.57582177 1.34189421 0.87050042 0.01626120 -## [13] 0.38468103 0.73310269 -1.72875890 -0.10449957 2.10033687 0.74667590 -## [19] 0.54591787 -0.92583802 +## [1] -0.16143681 0.89292580 -0.20283823 -0.66093683 0.74770696 -1.12698358 +## [7] 1.24983984 0.68528159 1.15367603 0.65217918 0.38289490 1.28464447 +## [13] -0.72711595 0.35867638 -0.46620195 0.98732824 -1.98668058 -1.45041296 +## [19] -1.54257769 -0.06996881 ```