| 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. Point out the wrong statement :

Correct Answer is : When you call unserialize() on an R object, the output will be a raw vector coded in hexadecimal format

2. ________ opens a connection to a file compressed with gzip.

Correct Answer is : gzfile

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

Correct Answer is : file

4. Which of the following code creates a connection to ‘foo.txt’ ?

Correct Answer is : con <- file(“foo.txt”)

5. Which of the following code opens a connection to the file foo.txt, reads from it, and closes the connection when its done ?

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

6. .Which of the following opens connection to gz-compressed text file ?

Correct Answer is : con <- gzfile(“words.gz”)

7. What would be the result of following R code ? > x <- 1 > print(x)

Correct Answer is : 1

8. Point out the wrong statement :

Correct Answer is : The ## character indicates a comment

9. Files containing R scripts ends with extension :

Correct Answer is : .R

10. Point out the wrong statement :

Correct Answer is : The numbers in the square brackets are part of the vector itself

11. If commands are stored in an external file, say commands.R in the working directory work, they may be executed at any time in an R session with the command :

Correct Answer is : source(“commands.R”)

12. _______ will divert all subsequent output from the console to an external file.

Correct Answer is : sink

13. The entities that R creates and manipulates are known as ________

Correct Answer is : objects

14. Which of the following can be used to display the names of (most of) the objects which are currently stored within R ?

Correct Answer is : objects()

15. Collection of objects currently stored in R is called as :

Correct Answer is : workspace

16. What is the meaning of the following function? x <- c(4, 5, 1, 2, 3, 3, 4, 4, 5, 6) x <- as.factor(x)

Correct Answer is : x becomes a factor

17. What is the meaning of the following function? print( sqrt(2) )

Correct Answer is : 1.414214

18. What is the output of the following function? d <- date() d

Correct Answer is : Prints exact present time and date.

19. What is the output of the following function? paste("Everybody", "is", “a” , "warrior")

Correct Answer is : “Everybody is a warrior”

20. What is the output of the following function? cat("Everybody", "is", "a", “warrior”,sep="*")

Correct Answer is : Everybody*is*a*warrior