
Learning the Verbiage
A few of the common terms encountered in R are defined below. Array: An array in R can have one or more dimensions. It is simply a vector which is stored with additional attributes giving the dimensions and optionally names for those dimensions . A twodimensional array is the same thing as a matrix. Onedimensional arrays often look like vectors, but may be handled differently by some functions. Class: All objects in R have a class. For simple vectors this is just the mode, for example "numeric", "logical", "character" or "list". However, there are other possible values for "matrix", "array", "factor" and "data.frame" objects. To determine what class a specific object has use the class(ObjectName) function. Constant: Any number typed directly at the prompt is a constant and is evaluated. Data Frames: Data frames are matrixlike structures, in which the columns can be of different modes. Think of data frames as ‘data matrices’ with one row per observational unit but with (possibly) both numerical and categorical variables. Many experiments are best described by data frames: the treatments are categorical but the responses are numeric. A data frame generally has a names attribute labeling the variables and a row.names attribute for labeling the cases. Data Structures: See objects. Factors: Factors provide compact ways to handle categorical data. Factors are used to describe items that can have a finite number of values (gender, social class, etc.). Functions: Functions are themselves objects in R which can be stored in the project’s workspace. This provides a simple and convenient way to extend and simplify R. Most of the computations carried out in R involve the evaluation of functions. Functions are invoked by name with a list of arguments separated by commas. Lists: Lists are a general form of a vector in which the various elements need not be of the same mode. Lists provide a convenient way to return the results of a statistical computation. Matrices: Matrices are multidimensional generalizations of vectors. In fact, they are vectors that can be indexed by two or more indices and will be printed in special ways. Mode: The type of data contained within an object. For example, common modes for vectors are numeric, complex, logical, or character. To determine what mode a specific object has use the mode(ObjectName) function.
NULL: NULL is used whenever there is a need to indicate or specify that an object is absent. It should not be confused with a vector or list of zero length.The NULL object has no type and no modifiable properties. Objects: The entities R operates on are technically known as objects. Examples are vectors, lists, matrices, functions, etc. To determing the object type you can use the typeof(ObjectName) function. Operators: R allows the use of arithmetic expressions using operators similar to those of the C programming language. R contains a number of operators. A list of common operators can be found here. Packages: Packages are collections of R functions, data, and code compiled in a single identity. Installation of additional packages allows for a user to expand the functionality of R to meet specific need. Vectors: Vectors are onedimensional arrays that can contain numeric, logical, character, or complex values. All entries in a vector must be of the same class. For example, a vector cannot contain both numeric and character entries.
