Primitive Object Types

Table 7-1 shows all the built-in object types. I introduced these objects in Chapter 3, so they should seem familiar. I classified the object types into a few categories to make them easier to understand.

Basic vectors

These are vectors containing a single type of value: integers, floating-point numbers, complex numbers, text, logical values, or raw data.

Compound objects

These objects are containers for the basic vectors: lists, pairlists, S4 objects, and environments. Each of these objects has unique properties (described below), but each of them contains a number of named objects.

Special objects

These objects serve a special purpose in R programming: any, NULL, and .... Each of these means something important in a specific context, but you would never create an object of these types.

R language

These are objects that represent R code; they can be evaluated to return other objects.


Functions are the workhorses of R; they take arguments as inputs and return objects as outputs. Sometimes, they may modify objects in the environment or cause side effects outside the R environment like plotting graphics, saving files, or sending data over the network.


These are object types that are formally defined by R but which aren’t normally accessible within the R language. In normal R programming, you will probably never encounter any of the objects.

Bytecode Objects

If you use the bytecode compiler, R will generate bytecode objects that run on the R virtual machine. ...

Get R in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.