R notes

A vector can only contain objects of the same class. Empty vectors can be created with the vector() function.

Numbers in R are generally treated as double precision real numbers. This means that even if you see a number like “1” or “2” in R, which you might think of as integers, they are likely represented behind the scenes as numeric objects something like “1.00” or “2.00”.

Entering 1 in R gives you a numeric object; entering 1L explicitly gives you an integer object. If you explicitly want an integer, you need to specify the L suffix.

Number Inf represents infinity in R.

Attributes of an object (if any) can be accessed using the attributes() function. Not all R objects contain attributes, in which case the attributes() function returns NULL.