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).

Objects can have attributes, which include:

Note that more specialized R-objects such as objects 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


Citation

The E-Learning project SOGA-R was developed at the Department of Earth Sciences by Kai Hartmann, Joachim Krois and Annette Rudolph. You can reach us via mail by soga[at]zedat.fu-berlin.de.

Creative Commons License
You may use this project freely under the Creative Commons Attribution-ShareAlike 4.0 International License.

Please cite as follow: Hartmann, K., Krois, J., Rudolph, A. (2023): Statistics and Geodata Analysis using R (SOGA-R). Department of Earth Sciences, Freie Universitaet Berlin.