class()
   get_help() docs


Description

The class() function comes with R and is part of the Base R {base} package.

We use this function to determine what type of value an object or value is, i.e. is the value a numeric, logical, character, etc.

Conceptual Usage

class(variable or value of interest)

Examples

# Find the type of the value 5
class(5)
## [1] "numeric"


# Find the type of the value 'this is a string'
class('this is a string')
## [1] "character"


# Find the type of a previously defined variable
x <- 75.5
class(x)
## [1] "numeric"