Basics Flashcards

1
Q

Assigning values

A
  • x = ?

- x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Creating Vectors

A
  • x = c(?, ?, ?, ?,?)

- x = c(“?”, “?”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Sequencing

A
  • x:y

- seq(from=x, to=y, by=?)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Repeating

A
  • rep(x, times=?)

- rep(“?”, times=?)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Extracting from a vector

A
E.g. if: 
y = c(1, 3, 5, 7, 9)
then:
y[3]
would extract the third number = 5
if:
y = c(1, 3, 5, 7, 9)
then 
y[-3]
would extract everything but the third number = 1 3 7 9
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Constructing a matrix

A

matrix(c(?,?,?,?,?,?), nrow=?, byrow=TRUE/FALSE)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Extracting from a matrix

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly