1-4 Flashcards

1
Q

create a vector

A

c(…) c for concatenate

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

what is the tast of a function

A

?c without ()

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

What if vectors have different length?

A

‘recycles’ the shorter vector until it is the same length as the longer vector.

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

Get previous code

A

hitting the up arrow

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

List all the files in your working directory

A

list.files() or dir().

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

What arguments takes a function?

A

args(func_name)

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

Create a sequence of numbers, 1 to 20. Two ways

A

1:20

seq(0,10)

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

Sequence 0.5er Schritte 1 bis 20

A

seq(1,20, by=0.5)

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

sequence of 30 numbers between 5 and 10

A

seq(5, 10, length=30)

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

get a sequence as long as the function_name one

A

seq_along(function_name)

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

vector that contains 40 zeros

A

rep(0, times = 40)

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

vector to contain 10 zeros, then 10 ones, then 10 twos

A

rep(c(0, 1, 2), each = 10) rep for replicate

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