1. Which of the following is true about R?
A . R is a programming language
B . R is used for statistical computing
C . R has extensive graphical capabilities
D . All of the above
2. How do you install a package in R?
A . install("package_name")
B . install.package("package_name")
C . install.packages("package_name")
D . install.packages package_name
3. What command is used to check installed packages in R?
A . installed.packages()
B . list.packages()
C . show.packages()
D . get.packages()
4. Which of the following is NOT an R Object type?
A . Character
B . List
C . Tuple
D . Factor
5. What does c(1, 2, 3, 4) create in R?
A . A list
B . A vector
C . A data frame
D . A matrix
6. Which operator is used for assignment in R?
A . <-
B . ->
C . =
D . All of the above
7. What function is used to check the data type of an object?
A . typeof()
B . class()
C . mode()
D . All of the above
8. What does as.integer(4.7) return?
A . 4.7
B . 5
C . 4
D . Error
9. What will be the output of 10 %% 3 in R?
A . 1
B . 3
C . 0
D . 10
10. What is the result of 10 %/% 3?
A . 3.33
B . 3
C . 10
D . 1
11. Which function rounds 3.76 to the nearest integer?
A . round(3.76)
B . floor(3.76)
C . ceiling(3.76)
D . trunc(3.76)
12. How do you create a factor variable in R?
A . as.factor()
B . factor()
C . convert.factor()
D . as.category()
13. Which of the following is a logical operator in R?
A . &
B . |
C . !
D . All of the above
14. How do you check if a value is missing in R?
A . is.missing()
B . is.na()
C . is.null()
D . missing()
15. What is the default mode of a numeric value in R?
A . integer
B . double
C . float
D . complex
16. How do you generate a sequence from 1 to 10 with step size 2?
A . seq(1,10,2)
B . sequence(1,10,2)
C . generate(1,10,2)
D . seq(1,10,by=2)
17. What is the class of TRUE in R?
A . Character
B . Logical
C . Numeric
D . Integer
18. Which function is used to round numbers in R?
A . round()
B . ceiling()
C . floor()
D . All of the above
19. What does the expression df$column return?
A . A vector
B . A data frame
C . A list
D . A matrix
20. Which operator is used for subsetting a data frame in R?
A . $
B . []
C . [[]]
D . All of the above
21. Which operator is used for integer division in R?
A . /
B . %/%
C . %%
D . *
22. Which of the following is a valid variable name in R?
A . 1var
B . _var
C . var1
D . var-1
23. What does the expression x[1] return if x is a vector?
A . The first element of x
B . The last element of x
C . The length of x
D . The type of x
24. What is the default value of a logical object in R?
A . TRUE
B . FALSE
C . NA
D . NULL
25. ____________________ function returns the number of elements in a vector?
26. ______________ function creates a matrix in R?
27. ______________ function is used to concatenate two strings in R?
28. What does rep(4, times=5) do_______________________?
29. ___________ function combines multiple elements into a vector?
30. What is the output of class(3L) ?__________________________
☞ R - Programming MCQs - Unit-1 - [ R-Programming ]
☞ R - Programming MCQs - Unit-2 - [ R-Programming ]
☞ R - Programming MCQs - Unit-3 - [ R-Programming ]
☞ R - Programming MCQs - Unit-4 - [ R-Programming ]
☞ R - Programming MCQs - Unit-5 - [ R-Programming ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]
☞ PPS MCQs - Unit-1 - [ PPS ]
☞ PPS MCQs - Unit-2 - [ PPS ]
☞ PPS MCQs - Unit-3 - [ PPS ]
☞ PPS MCQs - Unit-4 - [ PPS ]
☞ PPS MCQs - Unit-5 - [ PPS ]
☞ Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]
☞ Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]
☞ Software Engineering MCQs - Unit-1 - [ SE ]
☞ Software Engineering MCQs - Unit-2 - [ SE ]
☞ Software Engineering MCQs - Unit-3 - [ SE ]
☞ Software Engineering MCQs - Unit-4 - [ SE ]
☞ Software Engineering MCQs - Unit-5 - [ SE ]
☞ Data Mining MCQs - Unit-1 - [ DM ]
☞ Data Mining MCQs - Unit-2 - [ DM ]
☞ Data Mining MCQs - Unit-3 - [ DM ]
☞ Data Mining MCQs - Unit-4 - [ DM ]
☞ Data Mining MCQs - Unit-5 - [ DM ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]
☞ Data Structures Objective Type Question Bank-Unit-1 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-2 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-3 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-4 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-5 - [ DS ]
☞ Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]
☞ Cyber Forensics Objective Type Question Bank-Part-2 - [ Cyber Forensics ]
☞ Cyber Forensics Objective Type Question Bank-Part-1 - [ Cyber Forensics ]
☞ Java Programming Objective Type Question Bank - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-1 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-2 - [ Java Programming ]