Let's now examine how elements can be selected from various class features.
At this point in the chapter, you probably already suspect that in order to select specific items from a vector, the selection condition must be enclosed in
There are basically three ways of selecting elements from arrays in R. They are as follows:
> LETTERS[c(1,5,6)]  "A" "E" "F"
LETTERS is a character vector built-in object in R that contains the entire alphabet in upper case. For lower case, use
Using negative subscripts removes specific elements from an object (unlike in languages such as Python, where it implies reverse ...