ANALYSIS
Practical 1: classroom introduction
1. Basic syntax of R
R uses the command line: not a graphical click-and-point interface
Typing your commands in an editor saved in a text file
First, open R x64 4.1.2: then you get the crude R graphical user interface. You can type after the red
arrow. You can also assign a certain result or calculation to a particular object: here we use a. From
now on, R knows that a stands for 15.
You can then use this a to do calculations, for example log(a). This log is what they call a ‘function’ in
R: like the working horse in R. These objects can perform statistical functions. a is the input of the log
function, and the input of a R function is referred to as an argument. The output of this calculation
can then again be assigned to another object, for example b.
a <- 25 R is case-sensitive!
b <- log(a)