Home / CSE MCQs / R Programming MCQs :: R Programming Nuts, Bolts, Getting Data In and Out

CSE MCQs :: R Programming MCQs

  1. Point out the correct statement :
  2. A.
    Empty vectors can be created with the vector() function
    B.
    A sequence is represented as a vector but can contain objects of different classes
    C.
    raw" objects are commonly used directly in data analysis
    D.
    None of the mentioned

  3. Point out the correct statement :
  4. A.
    The value NaN represents undefined value
    B.
    Number Inf represents infinity in R
    C.
    NaN can also be thought of as a missing value
    D.
    None

  5. Data frames can be converted to a matrix by calling data._______
  6. A.
    matr()
    B.
    mat()
    C.
    matrix()
    D.
    All of the mentioned

  7. Which of the following statement changes column name to h and f ?
  8. A.
    colnames(m) <- c("h", "f")
    B.
    columnnames(m) <- c("h", "f")
    C.
    rownames(m) <- c("h", "f")
    D.
    None of the mentioned

  9. Point out the wrong statement :
  10. A.
    matrices or more generally arrays are multi-dimensional generalizations of vectors
    B.
    factors provide compact ways to handle categorical data
    C.
    vectors provide a convenient way to return the results of a statistical computation
    D.
    All of the mentioned

  11. What would the following code print ?

    x - c("a", "b", "c")
    as.logical(x)
  12. A.
    a b c
    B.
    NA NA NA
    C.
    0 1 2
    D.
    All of the mentioned

  13. What would be the output of the following code ?

    m - matrix(nrow = 2, ncol = 3)
    dim(m)
  14. A.
    3 2
    B.
    2 3
    C.
    2 2
    D.
    None of the mentioned

  15. What would be the output of the following code ?

    sqrt(-17)
  16. A.
    -4.02
    B.
    4.02
    C.
    NaN
    D.
    None of the mentioned

  17. Point out the correct statement :
  18. A.
    The usual operator, -, can be thought of as a syntactic short-cut to expression operation
    B.
    Assignment can also be made using the function assignment()
    C.
    Vectors can be used in arithmetic expressions, in which case the operations are performed element by element
    D.
    None of the mentioned