R interview questions part 8

R interview questions part 8

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

Total Questions: 20

1. Which of the following is used for generating sequences ?

Correct Answer is : seq()

2. Which of the following statement would print “0” “1” “2” “3” “4” “5” “6” for the following code ? > x <- 0:6

Correct Answer is : as.character(x)

3. Point out the correct statement :

Correct Answer is : rep() is be used for replicating an object in various complicated ways

4. What would be the result of following code ? x <- c("a", "b", "c") > as.numeric(x)

Correct Answer is : Warning

5. What would the following code print ? > x <- c("a", "b", "c") > as.logical(x)

Correct Answer is : NA NA NA

6. Point out the correct statement :

Correct Answer is : Matrices are vectors with a dimension attribute

7. What would be the output of the following code ? > m <- matrix(nrow = 2, ncol = 3) > dim(m)

Correct Answer is : 45325

8. What would the following code print ? > m <- 1:10 > m

Correct Answer is : 1 2 3 4 5 6 7 8 9 10

9. Find the following type of vector? a <- c(1,2,5.3,6,-2,4)

Correct Answer is : Numeric

10. All columns in a matrix must have the same mode and the _________ length.

Correct Answer is : Same

11. ___________ provides optional labels with the columns and rows.

Correct Answer is : Dimnames

12. ________ are similar to matrices but can have more than two dimensions.

Correct Answer is : Arrays

13. Which is more general than a matrix, in that different columns can have different modes?

Correct Answer is : Data sets

14. An ordered collection of objects or components are called ________

Correct Answer is : Lists

15. The ________ stores the nominal values as a vector of integers in the range of 1 to unique values in the nominal variable.

Correct Answer is : Factor

16. An ordered factor is used to represent an __________

Correct Answer is : Ordinal variable

17. On what basis of a variable, OS allocates memory and decides what can be stored in the reserved memory?

Correct Answer is : Data types

18. The data type of the R-object becomes the data type of the ________

Correct Answer is : Variables

19. Which function is used to combine the elements into a vector?

Correct Answer is : C()

20. A __________ is an R-object which can contain many different types of elements inside it.

Correct Answer is : Lists

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon