R Language quiz questions

R Language interview questions

  • 1.

    Which of the followin code extracts the second column for the following matrix ?

     > x <- matrix(1:6, 2, 3)

     

    1. x[2, ]

    2. x[1, 2]

    3. x[, 2]

    4. All of the mentioned

    Answer
  • 2.

    What would be the output of the following code ?

    > x <- matrix(1:6, 2, 3)
    > x[1, ]

     

    1. 1 3 5

    2. 2 3 5

    3. 3 3 5

    4. file

    Answer
  • 3.

    What would be the output of the following code ?

    > x <- matrix(1:6, 2, 3)
    > x[1, 2]

     

    1. 3

    2. 2

    3. 1

    4. 0

    Answer
  • 4.

    Point out the wrong statement :

    1. $ operator semantics are similar to that of [[

    2. The [ operator always returns an object of the same class as the original

    3. The $ operator is used to extract elements of a list or a data frame

    4. All of the mentioned

    Answer
  • 5.

    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

    Answer
  • 6.

    Which of the following extracts first four element from the following vector ?

     > x <- c("a", "b", "c", "c", "d", "a")

     

    1. x[0:4]

    2. x[1:4]

    3. x[0:3]

    4. All of the mentioned

    Answer
  • 7.

    Point out the correct statement :

    1. There are three operators that can be used to extract subsets of R objects

    2. The [ operator is used to extract elements of a list or data frame by literal name

    3. The [[ operator is used to extract elements of a list or data frame by string name

    4. All of the mentioned

    Answer
  • 8.

    Which of the following extracts first element from the following vector ?

     > x <- c("a", "b", "c", "c", "d", "a")

     

    1. x[10]

    2. x[1]

    3. x[0]

    4. None of the mentioned

    Answer
  • 9.

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

    1. url

    2. gzfile

    3. bzfile
       

    4. file

    Answer
  • 10.

    ________ opens a connection to a file compressed with gzip.

    1. url

    2. gzfile

    3. bzfile

    4. file

    Answer
  • 11.

    Point out the wrong statement :

    1. When you call unserialize() on an R object, the output will be a raw vector coded in hexadecimal format

    2. serialize() function is the only way to perfectly represent an R object in an exportable format

    3. .rda extension is used when save() function is incorporated

    4. All of the mentioned

    Answer
  • 12.

    Which of the following statement will load the objects to the file named “mydata.RData” ?

    1. save(“mydata.RData”)

    2. load(“mydata.RData”)

    3. loadAll(“mydata.RData”)

    4. All of the mentioned

    Answer
  • 13.

    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

    Answer
  • 14.

    Point out the correct statement :

    1. The complement to the textual format is the binary format

    2. If you have a lot of objects that you want to save to a file, you can save all objects in your workspace using the save.image() function

    3. The serialize() function is used to convert individual R objects into a binary format that can be communicated across an arbitrary connection.

    4. All of the mentioned

    Answer
  • 15.

    Individual R objects can be saved to a file using the _____ function.

    1. save

    2. put

    3. save_image

    4. None of the mentioned

    Answer
  • 16.

    _________ is a JavaScript charting library and feature-rich API set that lets you build interactive Flash or HTML5 charts.

    1. InstantAtlas

    2. Alterian

    3. ZingChart

    4. None of the mentioned

    Answer
  • 17.

    ______ is simplest class of analytics.

    1. Descriptive

    2. Predictive

    3. Prescriptive

    4. All of the mentioned

    Answer
  • 18.

    Which of the following is preferred for text analytics ?

    1. R

    2. Python

    3. S

    4. All of the mentioned

    Answer
  • 19.

    __________ is proprietary tool for predictive analytics.

    1. R

    2. SAS

    3. SSAS

    4. All of the mentioned

    Answer
  • 20.

    Which of the following contains pre-built predictive tools ?

    1. alteryx

    2. fossilx

    3. paleoTS

    4. All of the mentioned

    Answer

© 2017 QuizBucket.org