Exercise
Creating and Inspecting Objects (vectors and
factors)
Create the following vectors or factors:
Name Content
Letters_vec A vector reading “A”, “B”, “C”
Numbers_vec A vector reading 1, 2, 3
Logic_vec A vector reading TRUE, FALSE
Big_vec A vector of the elements of the first three vectors
Seq_vec A vector reading as a sequence of full numbers from 1 to 20
Letters_fac A factor reading “A”, “B”, “C”
Numbers_fac A factor reading 1, 2, 3
Constrained_fac A factor reading 1, 2, 3, levels 1 and 2 are allowed
Expanded_fac A factor reading 1, 2, 3 levels 1 - 4 are allowed
Inspect these objects for their classes and dimensions!
Aarhus University Biostatistics - Why? What? How? 39 / 42