Sail E0 Webinar

MCQs

Total Questions : 12 | Page 1 of 2 pages
Question 1. A function, together with an environment, makes up what is called a ______ closure.
  1.    formal
  2.    function
  3.    reflective
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> function


The function closure model can be used to create functions that "carry around data with them.


Question 2. The _________ function is used to plot negative likelihood.
  1.    plot()
  2.    graph()
  3.    graph.plot()
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> plot()


For simple scatter plots, plot.default will be used.


Question 3. Point out the correct statement :
  1.    Blocks are evaluated until a new line is entered after the closing brace
  2.    Single statements are evaluated when a new line is typed at the start of the syntactically complete statement
  3.    The if/else statement conditionally evaluates two statements
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> The if/else statement conditionally evaluates two statements


The if/else statement returns, as its value, the value of the statement that was selected.


Question 4. Which will be the output of following code ?x - 3 switch(6, 2+2, mean(1:10), rnorm(5))
  1.    10
  2.    1
  3.    NULL
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> NULL


If value is too large or too small NULL is returned.


Question 5. Point out the correct statement :
  1.    R has a number of ways to indicate to you that something's not right
  2.    Executing any function in R may result in the condition
  3.    condition" is a generic concept for indicating that something unexpected has occurred
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


Programmers can create their own custom conditions if they want.


Question 6. Which of the following is primary tool for debugging ?
  1.    debug()
  2.    trace()
  3.    browser()
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> debug()


Primary tools are mainly used for debugging R code.


Question 7. _______ is used to skip an iteration of a loop.
  1.    next
  2.    skip
  3.    group
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> next


No statement below next in the current loop is evaluated.


Question 8. Point out the correct statement :
  1.    Vectorizing the function can be accomplished easily with the Vectorize() function
  2.    There are different levels of indication that can be used, ranging from mere notification to fatal error
  3.    Vectorizing the function can be accomplished easily with the vector() function
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Vectorizing the function can be accomplished easily with the Vectorize() function


Vectorize() function does not preserve the invisibility of the return value.


Question 9. Point out the correct statement :
  1.    split() takes elements of the list and passes them as the first argument of the function you are applying
  2.    You can use tsplit() to evaluate a function single time each with a same argument
  3.    Sequence of operations is sometimes referred to as map-reduce"
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


The results of applying the function over the subsets are then collated and returned as an object.


Question 10. The __________ function returns a list of all the formal arguments of a function
  1.    formals()
  2.    funct()
  3.    formal()
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> formals()


Functions have named arguments which can optionally have default values.


Latest Videos

Latest Test Papers