MCQs
Total Questions : 10
Answer: Option A. -> Empty vectors can be created with the vector() function
A vector can only contain objects of the same class
Answer: Option A. -> colnames(m)
Column names and row names can be set separately using the colnames() and rownames() functions.
Answer: Option C. -> vectors provide a convenient way to return the results of a statistical computation
The dimension attribute is itself an integer vector of length 2 (number of rows, number of columns).
Answer: Option C. -> matrix()
as.matrix() function should be used to coerce a data frame to a matrix.
Answer: Option B. -> Number Inf represents infinity in R
This allows us to represent entities like 1 / 0.
Answer: Option A. -> NULL
We can also create an empty list of a pre-specified length with the vector() function.
Answer: Option B. -> 2 3
Matrices are constructed column-wise.
Answer: Option C. -> Vectors can be used in arithmetic expressions, in which case the operations are performed element by element
Vectors occurring in the same expression need not all be of the same length.
Answer: Option C. -> NaN
These metadata can be very useful in that they help to describe the object.
Answer: Option B. -> NA NA NA
When nonsensical coercion takes place, you will usually get a warning from R.