Q. .RData extension used when we save data using the functions . . . . . . . .

  • (A) save()
  • (B) save.image()
  • (C) save and save.image functions
  • (D) serialize()
πŸ’¬ Discuss
βœ… Correct Answer: (C) save and save.image functions

Q. Which of the following extracts first element from the following R vector?
> x <- c("a", "b", "c", "c", "d", "a")

  • (A) x[10]
  • (B) x[1]
  • (C) x[0]
  • (D) x[2]
πŸ’¬ Discuss
βœ… Correct Answer: (B) x[1]

Q. Point out the correct statement?

  • (A) Times use the POSIXct and POSIXlt class
  • (B) Dates and times have special classes in R that allow for numerical and statistical calculations
  • (C) Character strings can be coerced to Date/Time classes using the strptime function
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned

Q. Which of the following R statement will save the output to the file for following R code?
> a <- data.frame(x = rnorm(100), y = runif(100))
> b <- c(3, 4.4, 1 / 3)

  • (A) save(a, b, file = "mydata.rda")
  • (B) save_image(a, b, file = "mydata.rda")
  • (C) keep(a, b, file = "mydata.rda")
  • (D) keep_image(a, b, file = "mydata.rda")
πŸ’¬ Discuss
βœ… Correct Answer: (A) save(a, b, file = "mydata.rda")

Q. The benefit of the . . . . . . . . function is that it is the only way to perfectly repressed an R object in an exportable format, without losing precision or any metadata.

  • (A) save()
  • (B) save.image()
  • (C) unserialize()
  • (D) serialize()
πŸ’¬ Discuss
βœ… Correct Answer: (D) serialize()

Q. What will be the output of the following R code?
> x <- as.Date("2012-01-01")
> y <- strptime("9 Jan 2011 11:34:21", "%d %b %Y %H:%M:%S")
> x-y

  • (A) Time difference of 356.3095 days
  • (B) Warning
  • (C) NULL
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) Warning

Q. Which of the following return a subset of the columns of a data frame?

  • (A) select
  • (B) retrieve
  • (C) get
  • (D) set
πŸ’¬ Discuss
βœ… Correct Answer: (A) select

Q. What will be the output of the following R code?
> x <- c("a", "b", "c", "c", "d", "a")
> x[c(1, 3, 4)]

  • (A) "a" "b" "c"
  • (B) "a" "c" "c"
  • (C) "a" "c" "b"
  • (D) "b" "c" "b"
πŸ’¬ Discuss
βœ… Correct Answer: (B) "a" "c" "c"

Q. Point out the wrong statement?

  • (A) Renaming a variable in a data frame in R is surprisingly hard to do
  • (B) The mutate() function exists to compute transformations of variables in a data frame
  • (C) mute() function, which does the same thing as mutate() but then drops all non-transformed variables
  • (D) The data frame is a key data structure in statistics and in R
πŸ’¬ Discuss
βœ… Correct Answer: (C) mute() function, which does the same thing as mutate() but then drops all non-transformed variables

Q. What will be the output of the following R code?
> x <- matrix(1:6, 2, 3)
> x[1, 2]

  • (A) 3
  • (B) 2
  • (C) 1
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (A) 3