ABSTRACT

This chapter provides a brief introduction to the R programming language. It focuses on more advanced applications of R for geospatial data processing, analysis, and visualization. The simplest way to use R is to type in a mathematical expression at the command prompt in the console and hit the Enter key. Several functions can be used to create vectors containing regular sequences of numbers or repeated values. One of the most important features of R is that it uses vector arithmetic to carry out element-wise mathematical operations without having to write code for looping. Multiple vectors of the same length can be combined to create a matrix, which is a two-dimensional object with columns and rows. Data frames are like matrices in that they have a rectangular format consisting of columns and rows, and they are like lists in that they can contain columns with different data types such as numeric, logical, character, and factor.