Week 1 Flashcards
1
Q
library()
A
- List of all packages installed on your computer
- displayed in R editor
2
Q
search()
A
List of all packages currently active on your computer
3
Q
install.packages(“< lib_name >”)
A
- package is downloaded from CRAN and installed on your computer
- also in Tools Menu (RStudio)
4
Q
library(“< lib_name >”)
A
- loads the library
- used after install.packages(_)
5
Q
library(help = “< lib_name >”)
A
package documentation listed in editor
6
Q
update.packages ()
A
- updates all packages
- also in Tools Menu (RStudio)
7
Q
detach(“ package:< lib_name> “, unload=TRUE)
A
- Package is removed
- Package can also be removed from the right hand side window
8
Q
Task
Clear the console
A
- Edit -> Clear Console
- Ctrl + L
9
Q
comments
A
- start with #
- single lines only
10
Q
run single command from script
A
- Ctrl + Enter
11
Q
index number
A
- first number displayed in [ ]
- indexes start at 1
12
Q
print(“string”)
A
- prints string and quotes
13
Q
assignment operator
A
- <-
- can also use =
14
Q
display variable value
A
type variable name in editor and execute
15
Q
concatenate vectors
A
c(x,y) = x values, y values
16
Q
multiple vectors subtraction
A
performs operation on values of same index
- x <- 5,5,5
- y <- 1,2,3
- x - y = 4,3,2
17
Q
vector multiplication
A
y * 3 = each value in y vector x 3