STATS 406 Lecture Notes - Lecture 2: Lattice Problem, Nan
Document Summary
Collection of objects of the same data type/mode. R will coerce your input to follow that rule. To create a vector, use the function vector or create a new variable. X6 = c(2+2i, complex(real=1, imag = 1)) (1:100, 10) 10 random numbers from 1 to 100. A function that can operate on a data type will operate on a vector of such data type. In an operation that involves two vectors of different lengths, the shortest vector is recycled to match the length of the longest. Logical can be true, false, or na (missing) Obey the rules of boolean algebra with operators and, or, and not. In r, and is &, or is |, and not is ! Logical vectors are typically the result of relational operations(comparisons) All, any, which operate on logical vectors. We can select subsets of a vector by inclusion, exclusion, name, and by logical indexing. Null is a special object called the null object.