Lecture 1 Flashcards
Intro to R Commands in R Functions in R Navigation hints Variables in R Multiple Values in Variables Using Packages
what’s on the RHS of RStudio (working environment)
output, variables
what’s on the LHS of RStudio
top = instructions to R bottom = console, type commands into R, get output back immediately
does it matter to have space or no space in basic arithmetic in R console? (eg: 10*3 vs 10 * 3)
no
what is the numerical operator commanding ‘power’? (eg: 2 to the power of 3)
numerical operator: ^
eg: 2^3
what is the numerical operator commanding ‘multiplication’? (eg: 2 multiplied by 3)
numerical operator: *
eg: 2*3
what is the numerical operator commanding ‘division’? (eg: 2 divided by 3)
numerical operator: /
eg: 2/3
what is the numerical operator commanding ‘summation’? (eg: 2 summed by 3)
numerical operator: +
eg: 2+3
what is the numerical operator commanding ‘subtraction’? (eg: 2 subtracted by 3)
numerical operator: +
eg: 2+3
what is the logical operator commanding ‘equality’? (eg: 2 + 2 is equal to 4)
logical operator: ==
eg: 2+2 == 4
what is the logical operator commanding ‘inequality’? (eg: 2 + 2 is NOT equal to 5)
logical operator: !=
eg: 2+2 != 5
what is the R’s response to logical operators?
[1] TRUE
or
[1] FALSE
what is the logical operator commanding ‘greater than’? (eg: 4 is greater than 2)
logical operator: >
eg: 4 > 2
what is the logical operator commanding ‘greater than equal to’? (eg: 2 is greater than equal to 2)
logical operator: >=
eg: 2 >= 2
what is the logical operator commanding ‘less than’? (eg: 2 is less than 4)
logical operator: <
eg: 2 < 4
what is the logical operator commanding ‘less than equal to’? (eg: 2 less than equal to 5)
logical operator: <=
eg: 2 <= 5
if T is TRUE, what would R response be when you input ‘T & T’
T & T = if T is TRUE AND T is TRUE, then output would be TRUE
if T is TRUE, what would R response be when you input ‘T | T’
the logical operator ‘|’ means OR
hence T is TRUE OR T is TRUE, then output is TRUE
if T is TRUE, what would R response be when you input ‘T | !T’
the logical operator ‘|’ means OR and the logical operator ! means NOT (!T = False)
hence T is TRUE OR NOT T is TRUE, then output is TRUE