Difference between revisions of "RPR-Installation"

From "A B C"
Jump to navigation Jump to search
m
m
Line 80: Line 80:
  
 
== Contents ==
 
== Contents ==
 +
 +
==Before you begin: Notation and Formatting==
 +
 +
 +
In this tutorial, I use specific notation and formatting to mean different things.
 +
 +
If you see footnotes<ref> ... and when you click on the arrow to the left, this will take you back to where you came from.</ref>, click on the number to read more.
 +
 +
This is normal text for explanations. It is written in a <u>proportionally spaced font</u>.
 +
 +
<code>Code formatting is for code examples, file- and function names, directory paths etc.</code> Code is written in a <u>monospaced font</u><ref>Proportional fonts are for elegant document layout. Monospaced fonts are needed to properly align characters in columns. For code and sequences, we alway use monospaced font. Code editors always use monospaced fonts, but since I need to eMail a lot of code and sequences, I have also set my '''eMail client''' to use monospaced font by default (Courier, or Monaco). I highly encourage you to do the same.</ref>.
 +
 +
'''Bold emphasis''' and <u>underlining</u> are to mark words as particularly important.
 +
 +
<span class="right">Examples of the <u>right</u> way to do something are highlighted green.</span>
 +
 +
<span class="wrong">Examples of the <u>wrong</u> way to do something are highlighted red.</span>
 +
 +
 +
{{task|1=
 +
Tasks and exercises are described in boxes with a blue background. You have to do them, they are not optional. If you have problems, you must contact me and not simply continue. All material builds on previous material, therefore you can't skip.
 +
}}
 +
 +
<div class="mw-collapsible mw-collapsed FAQ-box" data-expandtext="Notes for troubleshooting..." data-collapsetext="Collapse">
 +
What could possibly go wrong? ... <small>Click to expand.</small>&rarr;
 +
<div class="mw-collapsible-content" style="padding:10px;">
 +
 +
----
 +
 +
These sections have information about issues I encounter more frequently. They are required reading when you need to troubleshoot problems but also give background information that may be useful to '''avoid''' problems in the first place.
 +
 +
<small>Click to collapse.</small>↗
 +
 +
</div>
 +
</div>
 +
 +
'''"Metasyntactic variables"''': When I use notation  like <code>&lt;Year&gt;</code> in instructions, you type the year, the whole year and nothing but the year (e.g the four digits '''2017'''). You '''never''' type the angle brackets! I use the angle brackets only to indicate that you should note type '''Year''' literally, but <u>substitute</u> the correct value. You might encounter this notation as <code>&lt;path&gt;</code>, <code>&lt;filename&gt;</code>, <code>&lt;firstname lastname&gt;</code> and similar. To repeat: if I specify
 +
<your name>
 +
... and your name is Elcid Barrett, '''You''' type
 +
Elcid Barrett
 +
... and not &nbsp;<span class="wrong">&nbsp;<tt>your name</tt>&nbsp;</span>&nbsp; or &nbsp;<span class="wrong">&nbsp;<tt>&lt;Elcid Barret&gt;</tt>&nbsp;</span>&nbsp; or similar. <small>(Oh the troubles I've seen ...)</small>
 +
 +
 +
The sample code on this page sometimes copies text from the console, and sometimes shows the actual commands only. The <code>&gt;</code> character at the beginning of the line is always just '''R''''s ''input prompt'', it tells you that you can type something now - you never actually type <code>&gt;</code> at the beginning of a line. If you read:
 +
> getwd()
 +
... you need to type:
 +
getwd()
 +
 +
 +
If a line starts with <code>[1]</code> or similar, this is '''R''''s '''output''' on the console.<ref><code>[1]</code> means: the following is the first (often only) element of a vector.</ref> The <code>#</code> character marks the following text as a comment which is not executed by '''R'''. These are lines that you '''do not type'''. They are program output, or comments, not commands.
 +
 +
;Characters
 +
:Different characters mean different things for computers, and it is important to call them by their right name.
 +
* <code> ( ) </code>&nbsp;◁&nbsp;these are '''parentheses'''.
 +
* <code> [ ] </code>&nbsp;◁&nbsp;these are (square) '''brackets'''.
 +
* <code> &lt; &gt; </code>&nbsp;◁&nbsp;these are angle brackets.
 +
* <code> { } </code>&nbsp;◁&nbsp;these are (curly) '''braces'''.
 +
* <code> &nbsp;" </code>&nbsp;◁&nbsp;this, and '''only''' this is a quotation mark or double quote. All of these are not: <span class="wrong"><tt> “”„«» </tt></span>. They will break your code. Especially the first two are often automatically inserted by MSWord and hard to distinguish.<ref>Never, ever edit code in MS Word. Use '''R''' or '''RStudio'''. Actually, don't use notepad or TextEdit either.</ref>
 +
* <code> &nbsp;' </code>&nbsp;◁&nbsp;this, and '''only''' this is a single quote. All of these are not: <span class="wrong"><tt> ‘’‚‹› </tt></span>. They will break your code. Especially the first two are often automatically inserted by MSWord and hard to distinguish.
 +
 +
{{Vspace}}
 +
 +
{{Vspace}}

Revision as of 05:42, 17 August 2017

Installing R and RStudio


 

Keywords:  Notation; installing R and RStudio; project directory; notation


 



 


Caution!

This unit is under development. There is some contents here but it is incomplete and/or may change significantly: links may lead to nowhere, the contents is likely going to be rearranged, and objectives, deliverables etc. may be incomplete or missing. Do not work with this material until it is updated to "live" status.


 


Abstract

...


 

This unit ...

Prerequisites

You need to complete the following units before beginning this one:


 

Objectives

...


 

Outcomes

...


 

Deliverables

  • Time management: Before you begin, estimate how long it will take you to complete this unit. Then, record in your course journal: the number of hours you estimated, the number of hours you worked on the unit, and the amount of time that passed between start and completion of this unit.
  • Insights: If you find something particularly noteworthy about this unit, make a note in your insights! page.


 

Evaluation

Evaluation: NA

This unit is not evaluated for course marks.


 


Contents

Before you begin: Notation and Formatting

In this tutorial, I use specific notation and formatting to mean different things.

If you see footnotes[1], click on the number to read more.

This is normal text for explanations. It is written in a proportionally spaced font.

Code formatting is for code examples, file- and function names, directory paths etc. Code is written in a monospaced font[2].

Bold emphasis and underlining are to mark words as particularly important.

Examples of the right way to do something are highlighted green.

Examples of the wrong way to do something are highlighted red.


Task:
Tasks and exercises are described in boxes with a blue background. You have to do them, they are not optional. If you have problems, you must contact me and not simply continue. All material builds on previous material, therefore you can't skip.

What could possibly go wrong? ... Click to expand.


These sections have information about issues I encounter more frequently. They are required reading when you need to troubleshoot problems but also give background information that may be useful to avoid problems in the first place.

Click to collapse.

"Metasyntactic variables": When I use notation like <Year> in instructions, you type the year, the whole year and nothing but the year (e.g the four digits 2017). You never type the angle brackets! I use the angle brackets only to indicate that you should note type Year literally, but substitute the correct value. You might encounter this notation as <path>, <filename>, <firstname lastname> and similar. To repeat: if I specify

<your name>

... and your name is Elcid Barrett, You type

Elcid Barrett

... and not   your name   or   <Elcid Barret>   or similar. (Oh the troubles I've seen ...)


The sample code on this page sometimes copies text from the console, and sometimes shows the actual commands only. The > character at the beginning of the line is always just R's input prompt, it tells you that you can type something now - you never actually type > at the beginning of a line. If you read:

> getwd()

... you need to type:

getwd()


If a line starts with [1] or similar, this is R's output on the console.[3] The # character marks the following text as a comment which is not executed by R. These are lines that you do not type. They are program output, or comments, not commands.

Characters
Different characters mean different things for computers, and it is important to call them by their right name.
  • ( )  ◁ these are parentheses.
  • [ ]  ◁ these are (square) brackets.
  • < >  ◁ these are angle brackets.
  • { }  ◁ these are (curly) braces.
  •  "  ◁ this, and only this is a quotation mark or double quote. All of these are not: “”„«» . They will break your code. Especially the first two are often automatically inserted by MSWord and hard to distinguish.[4]
  •  '  ◁ this, and only this is a single quote. All of these are not: ‘’‚‹› . They will break your code. Especially the first two are often automatically inserted by MSWord and hard to distinguish.


 


 
  1. ... and when you click on the arrow to the left, this will take you back to where you came from.
  2. Proportional fonts are for elegant document layout. Monospaced fonts are needed to properly align characters in columns. For code and sequences, we alway use monospaced font. Code editors always use monospaced fonts, but since I need to eMail a lot of code and sequences, I have also set my eMail client to use monospaced font by default (Courier, or Monaco). I highly encourage you to do the same.
  3. [1] means: the following is the first (often only) element of a vector.
  4. Never, ever edit code in MS Word. Use R or RStudio. Actually, don't use notepad or TextEdit either.