Tsallaka zuwa abun ciki
Justice Tech School

R Variables

Assign with <-. Variables can hold any type and be reassigned. Use assign() and get() for names built from text, and rm() to remove one.

Example
name <- "Ada"
age <- 21
age <- age + 1
cat(name, "is", age, "\n")

Exercise

Assign a value.

n  10

Quiz Test

Can an R variable change type?

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