Skip to content
Justice Tech School

R Data Types

Basic types: numeric (double), integer (5L), character, logical (TRUE/FALSE), complex and NULL. class() and typeof() show the type.

Example
x <- 3.5; y <- 5L; z <- "text"; w <- TRUE
print(class(x)); print(class(y)); print(class(z)); print(class(w))

Exercise

Show the type.

(x)

Quiz Test

Which shows the type of an object?

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