Tsallaka zuwa abun ciki
Justice Tech School

Sequences

: makes ranges, seq() gives steps and rep() repeats values.

Example
print(1:5)
print(seq(0, 10, by = 2))
print(seq(0, 1, length.out = 5))
print(rep("a", 3))
print(rep(c(1, 2), times = 2))
print(10:7)

Exercise

Step by 2.

seq(0, 10,  = 2)

Quiz Test

What does 5:1 give?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.