R Interview Questions - 7 | Snaprecruit.com

R Interview Questions - 7 | Snaprecruit.com

R interview questions part 7

R interview questions part 7

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

Total Questions: 20

1. Point out the correct statement :

Correct Answer is : There are two statements that can be used to explicitly control looping

2. What will be the output of the following code? > centre <- function(x, type) { + switch(type, + mean = mean(x), + median = median(x), + trimmed = mean(x, trim = .1)) + } > x <- rcauchy(10) > centre(x, "mean")

Correct Answer is : gives mean with values depending on rcauchy values

3. R has ________ basic indexing operators.

Correct Answer is : three

4. R has how many atomic classes of objects ?

Correct Answer is : 5

5. Point out the correct statement :

Correct Answer is : Empty vectors can be created with the vector() function

6. Numbers in R are generally treated as _______ precision real numbers.

Correct Answer is : double

7. If you explicitly want an integer, you need to specify the _____ suffix.

Correct Answer is : L

8. Point out the correct statement :

Correct Answer is : Number Inf represents infinity in R

9. Attributes of an object (if any) can be accessed using the ______ function.

Correct Answer is : attributes()

10. R objects can have attributes, which are like ________ for the object.

Correct Answer is : metadata

11. Which of the following can be considered as object attribute ?

Correct Answer is : all of the mentioned

12. What would be the result of following code ? > x <- vector("numeric", length = 10) > x

Correct Answer is : 0 0 0 0 0 0 0 0 0 0

13. The ___ function can be used to create vectors of objects by concatenating things together.

Correct Answer is : c()

14. Which of the following statement is invalid ?

Correct Answer is : None of the mentioned

15. Point out the correct statement :

Correct Answer is : All of the mentioned

16. What would be the result of following code ? > x <- 6 > class(x)

Correct Answer is : “numeric”

17. What will the following code print ? > x <- 0:6 > as.logical(x)

Correct Answer is : FALSE TRUE TRUE TRUE TRUE TRUE TRUE

18. Point out the correct statement :

Correct Answer is : Vectors can be used in arithmetic expressions, in which case the operations are performed element by element

19. What would be the output of the following code ? > sqrt(-17)

Correct Answer is :

20. _______ function returns a vector of the same size as x with the elements arranged in increasing order

Correct Answer is : sort()

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon