R interview questions part 38

R interview questions part 38

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

Total Questions: 20

1. .rda extension used when saving data with function __________

Correct Answer is : save and save.image functions

2. .RData extension used when we save data using the functions ___________

Correct Answer is : save and save.image functions

3. When you call serialize() on an R object, the output will be ____ coded in hexadecimal format.

Correct Answer is : raw vector

4. The benefit of the _____ function is that it is the only way to perfectly repressed an R object in an exportable format, without losing precision or any metadata.

Correct Answer is : serialize()

5. load() is used for _______

Correct Answer is : reading

6. readlines is used for ____________

Correct Answer is : reading files

7. Which of the following is example of vectorized operation as far as subtraction is concerned ? > x <- 1:4 > y <- 6:9

Correct Answer is : x-y

8. Point out the wrong statement :

Correct Answer is : Very less operations in R are vectorized

9. What would be the output of the following code ? > x <- 1:4 > y <- 6:9 > z <- x + y > z

Correct Answer is : 7 9 11 13

10. What would be the output of the following code ? > x <- 1:4 > x > 2

Correct Answer is : FALSE FALSE TRUE TRUE

11. What would be the output of the following code ? > x <- 1:4 > y <- 6:9 > x/y

Correct Answer is : 0.1666667 0.2857143 0.3750000 0.4444444

12. Which of the following code represents internal representation of a Date object ?

Correct Answer is : unclass(as.Date(“1970-01-02”))

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

Correct Answer is : “1970-01-01”

14. What would be the output of the following code ? > x <- Sys.time() > class(x)

Correct Answer is : “POSIXct” “POSIXt”

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

Correct Answer is : weekdays

16. Point out the correct statement :

Correct Answer is : All of the mentioned

17. What would be the output of the following code ? > p <- as.POSIXlt(x) > names(unclass(p)) > p$wday

Correct Answer is : 1

18. 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

Correct Answer is : “2012-01-10 10:40:00 EST” “2011-12-09 09:10:00 EST”

19. Point out the wrong statement :

Correct Answer is : None of the mentioned

20. 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

Correct Answer is : Warning

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon