Tutorial by Examples

The most simple data structure available in R is a vector. You can make vectors of numeric values, logical values, and character strings using the c() function. For example: c(1, 2, 3) ## [1] 1 2 3 c(TRUE, TRUE, FALSE) ## [1] TRUE TRUE FALSE c("a", "b", "c") ## ...
Every object in R is assigned a class. You can use class() to find the object's class and str() to see its structure, including the classes it contains. For example: class(iris) [1] "data.frame" str(iris) 'data.frame': 150 obs. of 5 variables: $ Sepal.Length: num 5.1 4.9 4.7 4...
Data in R are stored in vectors. A typical vector is a sequence of values all having the same storage mode (e.g., characters vectors, numeric vectors). See ?atomic for details on the atomic implicit classes and their corresponding storage modes: "logical", "integer", "numeri...

Page 1 of 1