Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. What would be the output of the following code ? p - as.POSIXlt(x) names(unclass(p)) p$wday
  1.    1
  2.    2
  3.    3
  4.    NULL
 Discuss Question
Answer: Option A. -> 1


The POSIXlt object contains some useful metadata.


Question 2. What would be the output of the following code ?x - 1:4 y - 6:9 x/y
  1.    0.1666667 0.2857143 0.4444444
  2.    0.1666667 0.2857143 0.3750000 0.4444444
  3.    0.2857143 0.3750000 0.4444444
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> 0.1666667 0.2857143 0.3750000 0.4444444


Logical operations return a logical vector of TRUE and FALSE.


Question 3. Point out the wrong statement :
  1.    $ operator semantics are similar to that of [[
  2.    The [[ operator can take an integer sequence if you want to extract a nested element of a list
  3.    The $ operator can be used to extract multiple elements from a list
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> The $ operator can be used to extract multiple elements from a list


The [ operator can be used to extract multiple elements from a list.


Question 4. What would be the output of the following code ?x - 1:4 y - 6:9 z - x + y z
  1.    7 9 11 13
  2.    7 9 11 13 14
  3.    9 7 11 13
  4.    NULL
 Discuss Question
Answer: Option A. -> 7 9 11 13


This is simplest example of adding two vectors together.


Question 5. Which of the following argument denotes if the file has a header line ?
  1.    header
  2.    sep
  3.    file
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> header


sep is a string indicating how the columns are separated.


Question 6. What would be the output of the following code ?x - c("a", "b", "c", "c", "d", "a") x[c(1, 3, 4)]
  1.    a" b" c"
  2.    a" c" c"
  3.    a" c" b"
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> a" b" c"


The sequence does not have to be in order; you can specify any arbitrary integer vector.


Question 7. Columns can be arranged in descending order too by using the special ____ operator.
  1.    asc()
  2.    desc()
  3.    descending()
  4.    subset
 Discuss Question
Answer: Option B. -> desc()


This will sort the order in decreasing order.


Question 8. Point out the wrong statement :
  1.    The dplyr package was developed by Hadley Wickham of RStudio
  2.    The dplyr packageis an optimized and distilled version of his plyr package
  3.    The dplyr package provideS any new" functionality to R
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> The dplyr packageis an optimized and distilled version of his plyr package


The dplyr package does not provide any "new functionality to R.


Question 9. Which of the following statement will save the output to the file for following code ?a - data.frame(x = rnorm(100), y = runif(100)) b - c(3, 4.4, 1 / 3)
  1.    save(a, b, file = mydata.rda")
  2.    save_image(a, b, file = mydata.rda")
  3.    keep(a, b, file = mydata.rda")
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


You can save all objects in your workspace using the save.image() function.


Question 10. Connections to text files can be created with the ________ function.
  1.    url
  2.    gzfile
  3.    bzfile
  4.    file
 Discuss Question
Answer: Option D. -> file


The file() function has a number of arguments that are common to many other connection functions.


Latest Videos

Latest Test Papers