| Snaprecruit.com

| Snaprecruit.com

Interview question based on skill :

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. Which of the following code extracts 1st element of the 2nd element ? > x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))

Correct Answer is : x[[c(2, 1)]].

2. What would be the output of the following code ? > x <- list(aardvark = 1:5) > x[["a", exact = FALSE]]

Correct Answer is : 1 2 3 4 5

3. .What would be the output of the following code ? > x <- c(1, 2, NA, 4, NA, 5) > bad <- is.na(x) > print(bad)

Correct Answer is : FALSE FALSE TRUE FALSE TRUE FALSE

4. Which of the following is used for reading in saved workspaces ?

Correct Answer is : load

5. Point out the wrong statement :

Correct Answer is : all of the mentioned

6. ________ is used for outputting a textual representation of an R object

Correct Answer is : dput

7. Which of the following argument denotes if the file has a header line ?

Correct Answer is : header

8. Point out the correct statement :

Correct Answer is : save is used for saving an arbitrary number of R objects in binary format to a file

9. Which of the following statement would read file “foo.txt” ?

Correct Answer is : data <- read.table(“foo.txt”)

10. Which of the following function is identical to read.table ?

Correct Answer is : read.csv

11. Which of the following code would read 100 rows ?

Correct Answer is : initial <- read.table(“datatable.txt”, nrows = 100)

12. Unlike writing out a table or CSV file, dump() and dput() preserve the ______ so that another user doesn’t have to specify the all over again.

Correct Answer is : metadata

13. One way to pass data around is by de parsing the R object with _________

Correct Answer is : dput()

14. Main way to read the data back in (parsing it) using the function.

Correct Answer is : dget()

15. dput() output is in the form of ___________

Correct Answer is : R code

16. Multiple objects can be de parsed at once using the ______ function.

Correct Answer is : dput()

17. Multiple objects can be de parsed at once and read back using function _____

Correct Answer is : source()

18. We can dump() R objects to a file by passing _____

Correct Answer is : character vector of their names

19. If we want to save individual R objects to a file, we use the _______ function.

Correct Answer is : save()

20. If you have a lot of objects that you want to save to a file, we use ________ function.

Correct Answer is : save.image()