MCQ Practice
R Programming β Unit 3
Practice the following objective questions.
Click βShow Answerβ whenever you want to check your answer.
A
vector()
B
list()
C
array()
D
create.list()
Correct Answer
list()
A
Same
B
Integer only
C
Different
D
Character only
Correct Answer
Different
A
mylist[2]
B
mylist[[2]]
C
mylist(2)
D
mylist{2}
Correct Answer
mylist[[2]]
Correct Answer
$
A
new index
B
function
C
vector type
D
data frame
Correct Answer
new index
A
The element becomes zero
B
The element gets deleted
C
The element becomes NA
D
An error is generated
Correct Answer
The element gets deleted
A
apply()
B
lapply()
C
loop()
D
each()
Correct Answer
lapply()
Correct Answer
0
A
size()
B
count()
C
length()
D
list.size()
Correct Answer
length()
A
structure()
B
str()
C
typeof()
D
inspect()
Correct Answer
str()
A
Numbers only
B
Words and positions
C
Images and files
D
Functions and variables
Correct Answer
Words and positions
A
x[2] <- 0
B
delete(x[2])
C
x[[2]] <- NULL
D
remove(x, 2)
Correct Answer
x[[2]] <- NULL
A
read.list()
B
scan()
C
get.list()
D
import.list()
Correct Answer
scan()
A
Name based
B
Position based
C
Value based
D
Random
Correct Answer
Position based
A
dataframe()
B
data.frame()
C
create.data()
D
frame()
Correct Answer
data.frame()
A
Matrix
B
Function
C
String
D
Scalar
Correct Answer
Matrix
A
Matrix
B
Vector
C
List only
D
Function
Correct Answer
Vector
Correct Answer
$
A
matrix
B
vector
C
data.frame
D
list
Correct Answer
data.frame
A
size()
B
length()
C
dim()
D
shape()
Correct Answer
dim()
A
first()
B
head()
C
top()
D
rows()
Correct Answer
head()
A
First column
B
Second row
C
Second column
D
Entire data frame
Correct Answer
Second column
A
df + newcol
B
df$newcol <- vector
C
add(df, newcol)
D
df.column(newcol)
Correct Answer
df$newcol <- vector
Correct Answer
NULL
A
apply()
B
lapply()
C
rowapply()
D
column()
Correct Answer
apply()
A
transpose()
B
t()
C
trans()
D
rotate()
Correct Answer
t()
A
cbind()
B
merge()
C
rbind()
D
combine()
Correct Answer
rbind()
A
join()
B
merge()
C
combine()
D
match.data()
Correct Answer
merge()
True / False
R Programming β Unit 3
Check whether the following statements are True or False.
29
Lists can contain another list inside.
Answer
TRUE
30
All columns in a data frame must be of the same type.
Answer
FALSE