Q. What will be the output of the following R code?
> x <- as.Date("1970-01-01")
> x

  • (A) "1970-01-01"
  • (B) "1970-01-02"
  • (C) "1970-02-01"
  • (D) "1970-02-02"
πŸ’¬ Discuss
βœ… Correct Answer: (A) "1970-01-01"

Q. . . . . . . . . add new variables/columns or transform existing variables.

  • (A) mutate
  • (B) add
  • (C) apped
  • (D) arrange
πŸ’¬ Discuss
βœ… Correct Answer: (A) mutate

Q. Connections to text files can be created with the . . . . . . . . function.

  • (A) url
  • (B) gzfile
  • (C) bzfile
  • (D) file
πŸ’¬ Discuss
βœ… Correct Answer: (D) file

Q. .rda extension used when saving data with function . . . . . . . .

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

Q. What will be the output of the following R code?
> x <- matrix(1:4, 2, 2)
> y <- matrix(rep(10, 4), 2, 2)
> x * y

  • (A) [,1] [,2] [1,] 10 30 [2,] 20 40
  • (B) [,1] [,2] [1,] 10 30 [2,] 30 40
  • (C) [,1] [,2] [1,] 20 30 [2,] 20 40
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) [,1] [,2] [1,] 10 30 [2,] 20 40

Q. Which of the following R code creates a connection to 'foo.txt'?

  • (A) con <- file("foo.txt")
  • (B) open(con, "r")
  • (C) opencon(con, "r")
  • (D) ocon(con, "r")
πŸ’¬ Discuss
βœ… Correct Answer: (A) con <- file("foo.txt")

Q. The dplyr package can be installed from GitHub using the . . . . . . . . package.

  • (A) dev
  • (B) devtools
  • (C) devtool
  • (D) devdel
πŸ’¬ Discuss
βœ… Correct Answer: (B) devtools

Q. Point out the wrong statement?

  • (A) The dplyr package was developed by Hadley Wickham of RStudio
  • (B) The dplyr package is an optimized and distilled version of his plyr package
  • (C) The dplyr package provides any "new" functionality to R
  • (D) The dplyr package does not provide any "new" functionality to R
πŸ’¬ Discuss
βœ… Correct Answer: (C) The dplyr package provides any "new" functionality to R

Q. Columns can be arranged in descending order too by using the special . . . . . . . . operator.

  • (A) asc()
  • (B) desc()
  • (C) descending()
  • (D) subset
πŸ’¬ Discuss
βœ… Correct Answer: (B) desc()

Q. Point out the wrong statement?

  • (A) POSIXct is just a very large integer under the hood
  • (B) POSIXlt stores a bunch of other useful information like the day of the week, day of the year, month, day of the month
  • (C) There are a number of generic functions that work on dates and times to help you extract pieces of dates and/or times
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the mentioned