Home / CSE MCQs / R Programming MCQs :: R Programming Control Structures, Functions

CSE MCQs :: R Programming MCQs

  1. Point out the correct statement :
  2. A.
    Blocks are evaluated until a new line is entered after the closing brace
    B.
    Single statements are evaluated when a new line is typed at the start of the syntactically complete statement
    C.
    The if/else statement conditionally evaluates two statements
    D.
    All of the mentioned

  3. Which will be the output of following code ?

    x - 3
     switch(6, 2+2, mean(1:10), rnorm(5))
  4. A.
    10
    B.
    1
    C.
    NULL
    D.
    All of the mentioned

  5. _______ is used to skip an iteration of a loop.
  6. A.
    next
    B.
    skip
    C.
    group
    D.
    All of the mentioned

  7. Point out the correct statement :
  8. A.
    R has a number of ways to indicate to you that something's not right
    B.
    Executing any function in R may result in the condition
    C.
    condition" is a generic concept for indicating that something unexpected has occurred
    D.
    All of the mentioned

  9. Which of the following is primary tool for debugging ?
  10. A.
    debug()
    B.
    trace()
    C.
    browser()
    D.
    All of the mentioned

  11. Point out the correct statement :
  12. A.
    Vectorizing the function can be accomplished easily with the Vectorize() function
    B.
    There are different levels of indication that can be used, ranging from mere notification to fatal error
    C.
    Vectorizing the function can be accomplished easily with the vector() function
    D.
    None of the mentioned

  13. Functions are defined using the _________ directive and are stored as R objects
  14. A.
    function()
    B.
    funct()
    C.
    functions()
    D.
    All of the mentioned

  15. The __________ function returns a list of all the formal arguments of a function
  16. A.
    formals()
    B.
    funct()
    C.
    formal()
    D.
    All of the mentioned

  17. Which of the following is multivariate version of lapply ?
  18. A.
    apply()
    B.
    lapply()
    C.
    sapply()
    D.
    mapply()

  19. A function, together with an environment, makes up what is called a ______ closure.
  20. A.
    formal
    B.
    function
    C.
    reflective
    D.
    All of the mentioned