1-4 Flashcards
create a vector
c(…) c for concatenate
what is the tast of a function
?c without ()
What if vectors have different length?
‘recycles’ the shorter vector until it is the same length as the longer vector.
Get previous code
hitting the up arrow
List all the files in your working directory
list.files() or dir().
What arguments takes a function?
args(func_name)
Create a sequence of numbers, 1 to 20. Two ways
1:20
seq(0,10)
Sequence 0.5er Schritte 1 bis 20
seq(1,20, by=0.5)
sequence of 30 numbers between 5 and 10
seq(5, 10, length=30)
get a sequence as long as the function_name one
seq_along(function_name)
vector that contains 40 zeros
rep(0, times = 40)
vector to contain 10 zeros, then 10 ones, then 10 twos
rep(c(0, 1, 2), each = 10) rep for replicate