Difference between revisions of "RPR-Introduction"

From "A B C"
Jump to navigation Jump to search
m
m
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div id="BIO">
+
<div id="ABC">
  <div class="b1">
+
<div style="padding:5px; border:1px solid #000000; background-color:#97bed5; font-size:300%; font-weight:400; color: #000000; width:100%;">
Introduction to R
 
  </div>
 
 
 
  {{Vspace}}
 
 
 
<div class="keywords">
 
<b>Keywords:</b>&nbsp;
 
 
Introduction to R
 
Introduction to R
 +
<div style="padding:5px; margin-top:20px; margin-bottom:10px; background-color:#97bed5; font-size:30%; font-weight:200; color: #000000; ">
 +
(Introduction to R)
 +
</div>
 
</div>
 
</div>
  
{{Vspace}}
+
{{Smallvspace}}
 
 
  
__TOC__
 
  
{{Vspace}}
+
<div style="padding:5px; border:1px solid #000000; background-color:#97bed533; font-size:85%;">
 
+
<div style="font-size:118%;">
 
+
<b>Abstract:</b><br />
{{LIVE}}
 
 
 
{{Vspace}}
 
 
 
 
 
</div>
 
<div id="ABC-unit-framework">
 
== Abstract ==
 
 
<section begin=abstract />
 
<section begin=abstract />
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "abstract" -->
 
 
This page collects the learning units for an introduction to R.
 
This page collects the learning units for an introduction to R.
 
<section end=abstract />
 
<section end=abstract />
 +
</div>
 +
<!-- ============================  -->
 +
<hr>
 +
<table>
 +
<tr>
 +
<td style="padding:10px;">
 +
<b>Objectives:</b><br />
 +
* Install the actual course R scripts on your computer.
 +
</td>
 +
<td style="padding:10px;">
 +
<b>Outcomes:</b><br />
 +
* The ABC-units RStudio project is installed in its own directory on your computer and you are ready to work with the code.
 +
</td>
 +
</tr>
 +
</table>
 +
<!-- ============================  -->
 +
<hr>
 +
<b>Deliverables:</b><br />
 +
<section begin=deliverables />
 +
<ul>
 +
<li>You have installed the ABC-Units RStudio project and worked through the required introductory steps to set it up.</li>
 +
</ul>
 +
<section end=deliverables />
 +
<!-- ============================  -->
 +
<hr>
 +
<section begin=prerequisites />
 +
<b>Prerequisites:</b><br />
 +
This unit builds on material covered in the following prerequisite units:<br />
 +
*[[RPR-Coding_style|RPR-Coding_style (R Coding Style)]]
 +
<section end=prerequisites />
 +
<!-- ============================  -->
 +
</div>
  
{{Vspace}}
+
{{Smallvspace}}
 
 
  
== This unit ... ==
 
=== Prerequisites ===
 
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "prerequisites" -->
 
<!-- included from "ABC-unit_components.wtxt", section: "notes-prerequisites" -->
 
You need to complete the following units before beginning this one:
 
*[[RPR-Coding_style]]
 
  
{{Vspace}}
 
  
 +
{{Smallvspace}}
  
=== Objectives ===
 
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "objectives" -->
 
...
 
  
{{Vspace}}
+
__TOC__
 
 
 
 
=== Outcomes ===
 
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "outcomes" -->
 
...
 
 
 
{{Vspace}}
 
 
 
 
 
=== Deliverables ===
 
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "deliverables" -->
 
<!-- included from "ABC-unit_components.wtxt", section: "deliverables-milestone" -->
 
*<b>No separate deliverables</b>: This unit collects other units and has no deliverables on its own.
 
  
 
{{Vspace}}
 
{{Vspace}}
Line 68: Line 62:
  
 
=== Evaluation ===
 
=== Evaluation ===
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "evaluation" -->
 
<!-- included from "ABC-unit_components.wtxt", section: "eval-none" -->
 
 
<b>Evaluation: NA</b><br />
 
<b>Evaluation: NA</b><br />
:This unit is not evaluated for course marks.
+
<div style="margin-left: 2rem;">This unit is not evaluated for course marks.</div>
 
+
== Contents ==
{{Vspace}}
+
This is a "milestone unit". Its purpose is mostly to collect a number of preparatory units into a single, common prerequisite. You are expected to be familiar and competent with all preparatory material at this point, and to have '''documented your learning in your journal'''. After a few more preparatory tasks you are ready to explore the bioinformatics landscape. Proceed with the tasks below ...
  
 
</div>
 
<div id="BIO">
 
== Contents ==
 
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "contents" -->
 
<!-- included from "ABC-unit_components.wtxt", section: "milestone" -->
 
This is a "milestone unit". Its purpose is merely to collect a number of preparatory units into a single, common prerequisite. It has no contents of its own; you are expected to be familiar and competent with all preparatory material at this point.
 
  
 
==The ABC RStudio Project==
 
==The ABC RStudio Project==
Line 94: Line 79:
 
{{task|1=
 
{{task|1=
 
* Open RStudio and create a '''New Project...''' cloned from a git version control directory. The repository URL is <code><nowiki>https://github.com/hyginn/ABC-units</nowiki></code>. Create this in the same way as you did for the [[RPR-Setup#Git_Version_control|'''R'''-tutorial]].
 
* Open RStudio and create a '''New Project...''' cloned from a git version control directory. The repository URL is <code><nowiki>https://github.com/hyginn/ABC-units</nowiki></code>. Create this in the same way as you did for the [[RPR-Setup#Git_Version_control|'''R'''-tutorial]].
* As requested on the console, type <code>init()</code>. This will create a file called <code>.myProfile.R</code> and ask you for your UofT eMail address and Student ID. You need to enter the correct values because other scripts will assume that these variables exist and are valid.
+
* As requested on the console, type <code>init()</code>. This will setup and configure some files.
 
* Work through the task: <code>"Local script"</code> in the <code>RPR-Introduction.R</code> script.
 
* Work through the task: <code>"Local script"</code> in the <code>RPR-Introduction.R</code> script.
  
Line 101: Line 86:
 
{{Vspace}}
 
{{Vspace}}
  
 
{{Vspace}}
 
 
 
== Further reading, links and resources ==
 
<!-- {{#pmid: 19957275}} -->
 
<!-- {{WWW|WWW_GMOD}} -->
 
<!-- <div class="reference-box">[http://www.ncbi.nlm.nih.gov]</div> -->
 
 
{{Vspace}}
 
 
 
== Notes ==
 
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "notes" -->
 
<!-- included from "ABC-unit_components.wtxt", section: "notes" -->
 
<references />
 
 
{{Vspace}}
 
 
 
</div>
 
<div id="ABC-unit-framework">
 
 
== Self-evaluation ==
 
== Self-evaluation ==
<!-- included from "../components/RPR-Introduction.components.wtxt", section: "self-evaluation" -->
 
 
<!--
 
<!--
 
=== Question 1===
 
=== Question 1===
Line 143: Line 105:
 
===Understanding the setup===
 
===Understanding the setup===
  
Imagine you made a typo when you entered your eMail address and now the file <code>.myProfile.R</code> contains a mistake. How do you fix this?
+
Imagine you made a typo when you entered your eMail address and now the file <code>scripts/.myProfile.R</code> contains a mistake. How do you fix this?
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px">
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px">
 
Answer ...
 
Answer ...
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
<code>.myProfile.R</code> is itself a file in the local working directory. Simply open it with the RStudio editor, fix the error, and save. Then type <code>source(".myProfile.R")</code> into the console to overwrite the old (wrong) definition with the corrected one.
+
<code>scripts/.myProfile.R</code> is itself a file in the local working directory. Simply open it with the RStudio editor, fix the error, and save. Then type <code>source("scripts/.myProfile.R")</code> into the console.
  
 
</div>
 
</div>
Line 157: Line 119:
 
{{Vspace}}
 
{{Vspace}}
  
 
 
{{Vspace}}
 
 
 
<!-- included from "ABC-unit_components.wtxt", section: "ABC-unit_ask" -->
 
 
----
 
 
{{Vspace}}
 
 
<b>If in doubt, ask!</b> If anything about this learning unit is not clear to you, do not proceed blindly but ask for clarification. Post your question on the course mailing list: others are likely to have similar problems. Or send an email to your instructor.
 
 
----
 
 
{{Vspace}}
 
  
 
<div class="about">
 
<div class="about">
Line 182: Line 128:
 
:2017-08-05
 
:2017-08-05
 
<b>Modified:</b><br />
 
<b>Modified:</b><br />
:2017-08-05
+
:2020-09-18
 
<b>Version:</b><br />
 
<b>Version:</b><br />
:1.0
+
:1.0.1
 
<b>Version history:</b><br />
 
<b>Version history:</b><br />
 +
*1.0.1 Maintenance
 
*1.0 Completed to first live version.
 
*1.0 Completed to first live version.
 
*0.1 First stub
 
*0.1 First stub
 
</div>
 
</div>
[[Category:ABC-units]]
 
<!-- included from "ABC-unit_components.wtxt", section: "ABC-unit_footer" -->
 
  
 
{{CC-BY}}
 
{{CC-BY}}
  
 +
[[Category:ABC-units]]
 +
{{MILESTONE}}
 +
{{LIVE}}
 
</div>
 
</div>
 
<!-- [END] -->
 
<!-- [END] -->

Latest revision as of 09:11, 25 September 2020

Introduction to R

(Introduction to R)


 


Abstract:

This page collects the learning units for an introduction to R.


Objectives:

  • Install the actual course R scripts on your computer.

Outcomes:

  • The ABC-units RStudio project is installed in its own directory on your computer and you are ready to work with the code.

Deliverables:

  • You have installed the ABC-Units RStudio project and worked through the required introductory steps to set it up.

Prerequisites:
This unit builds on material covered in the following prerequisite units:


 



 



 


Evaluation

Evaluation: NA

This unit is not evaluated for course marks.

Contents

This is a "milestone unit". Its purpose is mostly to collect a number of preparatory units into a single, common prerequisite. You are expected to be familiar and competent with all preparatory material at this point, and to have documented your learning in your journal. After a few more preparatory tasks you are ready to explore the bioinformatics landscape. Proceed with the tasks below ...


The ABC RStudio Project

R-scripts and other resources for the learning units of this course are collected in an RStudio project. This makes it easy to update and distribute code. I push update material to the GitHub repository of the project for any unit, all you need to do is to pull the updated project to receive all updates and new files on your computer. Version control is really useful for this. However, there is an issue that you need to be aware of. If you create your own, local files and then commit them, git will complain that it would be overwriting such local material. As long as you don't commit your files then all should be fine. This means you'll need to do your own "versioning" by saving your own scripts under a different name from time to time. Once again: in this context:

  • saving your own files is fine;
  • committing your own files to version control will cause problems;
  • changes you make to course material files and save under the same filename (like adding comments and notes) will not persist, these changes will be overwritten with the next update. You need to "Save As..." with a new filename (for example, prefix the original name with "my").


 

Task:

  • Open RStudio and create a New Project... cloned from a git version control directory. The repository URL is https://github.com/hyginn/ABC-units. Create this in the same way as you did for the R-tutorial.
  • As requested on the console, type init(). This will setup and configure some files.
  • Work through the task: "Local script" in the RPR-Introduction.R script.


 

Self-evaluation

Understanding the setup

Imagine you made a typo when you entered your eMail address and now the file scripts/.myProfile.R contains a mistake. How do you fix this?

Answer ...

scripts/.myProfile.R is itself a file in the local working directory. Simply open it with the RStudio editor, fix the error, and save. Then type source("scripts/.myProfile.R") into the console.


 


 


About ...
 
Author:

Boris Steipe <boris.steipe@utoronto.ca>

Created:

2017-08-05

Modified:

2020-09-18

Version:

1.0.1

Version history:

  • 1.0.1 Maintenance
  • 1.0 Completed to first live version.
  • 0.1 First stub

CreativeCommonsBy.png This copyrighted material is licensed under a Creative Commons Attribution 4.0 International License. Follow the link to learn more.