Tsallaka zuwa abun ciki
Justice Tech School

R Operators

Arithmetic: + - * / ^ %% %/%. Comparison: == != < >. Assignment: <- and ->. %in% tests membership. Operators work on whole vectors at once.

Example
x <- c(1, 2, 3)
print(x * 2); print(x + x); print(3 %in% x)

Exercise

Membership test.

3  x

Quiz Test

What does x * 2 do on a vector?

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