A basic understanding of data types and data structures and how to operate on those, allows you to write better and more efficient code. Note that everything in R is an object. A good conceptual understanding of objects is important because manipulation of objects is a very common task.

R has six atomic vector types (atomic means that the vector only holds data of a single type and vectors can be thought of as contiguous cells containing data).

• character, e.g. “Berlin”, “R is awesome”
• numeric (real or decimal), e.g. 14, 22.598
• integer, e.g. 5L (the L tells R to store this as an integer)
• logical, e.g. TRUE, FALSE
• complex, e.g. 1+6i (complex numbers with real and imaginary parts)

Objects can have attributes, which include:

• names
• dimnames
• dim
• class
• attributes (contain metadata)

Note that more specialized R-objects, such as object referring to spatial data or time series data, among others, may have very different attributes.

R provides many functions to examine features of vectors and other objects, for example

• class()
• typeof()
• length()
• dim()
• attributes()