Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variable types (numeric, character, logical, function)

  • class

  • isa

  • numeric

  • character

  • logical

  • function

  • numeric: 1 34 2.7

  • character: "hello" "23"

  • logical: TRUE FALSE

  • function: class print

class(23)       # numeric
class(2.3)      # numeric
class(NaN)      # numeric

class("Hello")  # character
class("23")     # character

class(TRUE)     # logical
class(FALSE)    # logical
class(T)        # logical
class(F)        # logical
class(NA)       # logical

class(class)    # function
class(print)    # function

isa(2, "numeric")  # TRUE
isa("2", "character")  # TRUE
isa(FALSE, "logical")  # TRUE