R Language quiz questions

R Language interview questions

  • 1.

    The dplyr package can be installed from GitHub using the _______ package

    1. dev

    2. devtools

    3. devtool

    4. All of the mentioned

    Answer
  • 2.

    The _______ operator is used to connect multiple verb actions together into a pipeline

    1. pipe

    2. piper

    3. start

    4. All of the mentioned

    Answer
  • 3.

    ________ add new variables/columns or transform existing variables

    1. mutate

    2. add

    3. apped

    4. arrange

    Answer
  • 4.

    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

    Answer
  • 5.

    _________ generate summary statistics of different variables in the data frame, possibly within strata

    1. rename

    2. summarize

    3. set

    4. subset

    Answer
  • 6.

    _________ extract a subset of rows from a data frame based on logical conditions.

    1. rename

    2. filter

    3. set

    4. subset

    Answer
  • 7.

    Point out the correct statement :

    1. The data frame is a key data structure in statistics and in R

    2. R has an internal implementation of data frames that is likely the one you will use most often

    3. There are packages on CRAN that implement data frames via things like relational databases that allow you to operate on very very large data frames

    4. All of the mentioned

    Answer
  • 8.

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

    1. select

    2. retrieve

    3. get

    4. All of the mentioned

    Answer
  • 9.

    What would be the output of the following code ?

    > x <- matrix(1:4, 2, 2)
    > y <- matrix(rep(10, 4), 2, 2)
    > x %*% y

     

    1. [,1] [,2]
      [1,] 40 40
      [2,] 60 60
    2. [,1] [,2]
      [1,] 40 40
      [2,] 80 60
    3. [,1] [,2]
      [1,] 40 60
      [2,] 60 60
    4. None of the mentioned

    Answer
  • 10.

    What would be the output of the following code ?

    > x <- as.POSIXct("2012-10-25 01:00:00")
    > y <- as.POSIXct("2012-10-25 06:00:00", tz = "GMT")
    > y-x

     

    1. Time difference of 1 hour

    2. Time difference of 1 min

    3. Time difference of 1 sec

    4. None of the mentioned

    Answer
  • 11.

    Which of the followin code represents internal representation of a Date object ?

    1. class(as.Date(“1970-01-02”))

    2. unclass(as.Date(“1970-01-02”))

    3. unclassint(as.Date(“1970-01-02”))

    4. All of the mentioned

    Answer
  • 12.

    What would be the output of the following code ?

    > x <- as.Date("2012-03-01")
    > y <- as.Date("2012-02-28")
    > x-y

     

    1. Time difference of 3 days

    2. Time difference of 2 days

    3. Time difference of 1 days

    4. All of the mentioned

    Answer
  • 13.

    What would be the output of the following code ?

    > x <- as.Date("2012-01-01")
    > y <- strptime("9 Jan 2011 11:34:21", "%d %b %Y %H:%M:%S")
    > x-y

     

    1. Time difference of 356.3095 days

    2. Warning

    3. NULL

    4. All of the mentioned

    Answer
  • 14.

    Point out the wrong statement :

    1. POSIXct is just a very large integer under the hood

    2. POSIXlt stores a bunch of other useful information like the day of the week, day of the year, month, day of the month

    3. There are a number of generic functions that work on dates and times to help you extract pieces of dates and/or times

    4. None of the mentioned

    Answer
  • 15.

    What would be the output of the following code ?

    > datestring <- c("January 10, 2012 10:40", "December 9, 2011 9:10")
    > x <- strptime(datestring, "%B %d, %Y %H:%M")
    > x

     

    1. “2012-01-10 10:40:00 EST” “2011-12-09 09:10:00 EST”

    2. “2012-01-10 10:40:00 IST” “2011-12-09 09:10:00 IST”

    3. “2012-01-10 10:40:00 GMT” “2011-12-09 09:10:00 GMT”

    4. All of the mentioned

    Answer
  • 16.

    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

    Answer
  • 17.

    Point out the correct statement :

    1. Times use the POSIXct and POSIXlt class

    2. Dates and times have special classes in R that allow for numerical and statistical calculations

    3. Character strings can be coerced to Date/Time classes using the strptime function

    4. All of the mentioned

    Answer
  • 18.

    Which of the following function gives the day of the week ?

    1. weekdays

    2. months

    3. quarters

    4. All of the mentioned

    Answer
  • 19.

    What would be the output of the following code ?

    > x <- Sys.time()
    > class(x)

     

    1. “POSIXct” “POSIXt”

    2. “POSIXXt” “POSIXt”

    3. “POSIXct” “POSIct”

    4. None of the mentioned

    Answer
  • 20.

    What would be the output of the following code ?

    > x <- as.Date("1970-01-01")
    > x

     

    1. “1970-01-01”

    2. “1970-01-02”

    3. “1970-02-01”

    4. None of the mentioned

    Answer

© 2017 QuizBucket.org