Home > Internet Programming > Quizzes > R (Programming Language) Quiz
R (Programming Language) Quiz
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 32% Most missed: “'x' is a vector of type integer, as shown on line 1 below. What is the type of t…”

R (Programming Language) MCQs For LinkedIn Skill Assessments.

R (Programming Language) Quiz
Time left 00:00
25 Questions

1. If 'mdf' is a data frame, which statement is true ?
2. How to name rows and columns in DataFrames and Matrices F in R?
3. A variable whose type is numeric can contain which items?
4. What value does this statement return?
'unclass(as.Date('1971-01-01'))'
5. What does the 'MyMat[ ,3]' subsetting operation return for this code?
r
MyMat = matrix(c(7, 9, 8, 6, 10, 12),nrow=2,ncol=3, byrow = TRUE)
6. You accidentally display a large data frame on the R console, losing all the statements you entered during the current session. What is the best way to get the prior 25 statements back?
7. Which function in R combines different values into a single object?
8. Review line 1 below. What does the statement in line 2 return?

1 mylist <- list(1,2,'C',4,5)
2 unlist(mylist)
9. 'x' is a vector of type integer, as shown on line 1 below. What is the type of the result returned by the statement > median(x)?
'x <- c(12L, 6L, 10L, 8L, 15L, 14L, 19L, 18L, 23L, 59L)'
10. Which choice does R regard as an acceptable name for a variable?
11. A list can contain a list as an element. '
MyList' has five columns, and the third column's item is a list of three items. How do you put all seven values in '
MyList' into a single vector?
12. What does R return in response to the final statement?

x<-5:8
names(x)<-letters[5:8]
x
13. How do you return 'October' from x in this code?

x<-as.Date('2018-10-01')
14. What is the principal difference between an array and a matrix?
15. What do you use to take an object such as a data frame out of the workspace?
16. A data frame named d.pizza is part of the DescTools package. A statement is missing from the following R code and an error is therefore likely to occur. Which statement is missing?

library(DescTools)
deliver <- aggregate(count,by=list(area,driver), FUN=mean)
print(deliver)
17. Which function displays the first five rows of the data frame named pizza?
18. Which file contains settings that R uses for all users of a given installation of R?
19. How do you extract the values above the main diagonal from a square matrix named 'Rmat'?
20. In the image below, the data frame on lines 1 through 4 is named StDf. State and Capital are both factors. Which statement returns the results shown on lines 6 and 7?
![Image](https://i.ibb.co/8DL1HCV/Captura-de-pantalla-2020-07-14-a-las-18-33-34.png' >
21. Which is not a property of lists and vectors?
22. How does a vector differ from a list?
23. Which of the following statements doesn't yield the code output below. Review the following code. What is the result of line 3?

x <- c(1, 2, 3, 4)
Output: [1] 2 3 4
24. What is the value of names(v[4])?

v <- 1:3
names(v) <- c('a', 'b', 'c')
v[4] <- 4
25. How do you obtain the row numbers in a data frame named 'pizza' for which the value of 'pizza$delivery_min' is greater than or equal to 30?