MCQ Practice
R Programming β Unit 1
Practice the following objective questions.
Click βShow Answerβ whenever you want to check your answer.
A
R is a programming language
B
R is used for statistical computing
C
R has extensive graphical capabilities
D
All of the above
Correct Answer
All of the above
A
install("package_name")
B
install.package("package_name")
C
install.packages("package_name")
D
install.packages package_name
Correct Answer
install.packages("package_name")
A
installed.packages()
B
list.packages()
C
show.packages()
D
get.packages()
Correct Answer
installed.packages()
A
Character
B
List
C
Tuple
D
Factor
Correct Answer
Tuple
A
A list
B
A vector
C
A data frame
D
A matrix
Correct Answer
A vector
A
<-
B
->
C
=
D
All of the above
Correct Answer
All of the above
A
typeof()
B
class()
C
mode()
D
All of the above
Correct Answer
All of the above
Correct Answer
4
Correct Answer
1
Correct Answer
3
A
round(3.76)
B
floor(3.76)
C
ceiling(3.76)
D
trunc(3.76)
Correct Answer
round(3.76)
A
as.factor()
B
factor()
C
convert.factor()
D
as.category()
Correct Answer
factor()
A
&
B
|
C
!
D
All of the above
Correct Answer
All of the above
A
is.missing()
B
is.na()
C
is.null()
D
missing()
Correct Answer
is.na()
A
integer
B
double
C
float
D
complex
Correct Answer
double
A
seq(1,10,2)
B
sequence(1,10,2)
C
generate(1,10,2)
D
seq(1,10,by=2)
Correct Answer
seq(1,10,by=2)
A
Character
B
Logical
C
Numeric
D
Integer
Correct Answer
Logical
A
round()
B
ceiling()
C
floor()
D
All of the above
Correct Answer
All of the above
A
A vector
B
A data frame
C
A list
D
A matrix
Correct Answer
A vector
A
$
B
[]
C
[[]]
D
All of the above
Correct Answer
All of the above
Correct Answer
%/%
A
1var
B
_var
C
var1
D
var-1
Correct Answer
var1
A
The first element of x
B
The last element of x
C
The length of x
D
The type of x
Correct Answer
The first element of x
A
TRUE
B
FALSE
C
NA
D
NULL
Correct Answer
FALSE
Quick Revision
Fill in the Blanks
Complete the following R Programming questions.
01
____________________ function returns the number
of elements in a vector?
Answer
length()
02
______________ function creates a matrix in R?
Answer
matrix()
03
______________ function is used to concatenate two
strings in R?
Answer
paste()
04
What does rep(4, times=5) do_______________________?
Answer
Creates a vector with five 4βs
05
___________ function combines multiple elements
into a vector?
Answer
c()
06
What is the output of class(3L) ?__________________________
Answer
"integer"