
1.
Point out the wrong statement :
matrices or more generally arrays are multidimensional generalizations of vectors
factors provide compact ways to handle categorical data
vectors provide a convenient way to return the results of a statistical computation
All of the mentioned
Answer

2.
What would the following code print ?
> x < list(1, "a", TRUE, 1 + 4i)
> x
A)
[[1]]
[1] 1
[[2]]
[1] "a"
[[3]]
[1] TRUE
[[4]]
[1] 1+4i
B)
[[1]]
[1] 2
[[2]]
[1] "b"
[[3]]
[1] TRUE
[[4]]
[1] 1+4i
C)
[[1]]
[1] 3
[[2]]
[1] "a"
[[3]]
[1] TRUE
[[4]]
[1] 1+4i
D) All of the mentioned
A
B
C
D
Answer

3.
What would be the result of following code ?
> x < 1:3
> y < 10:12
> rbind(x, y)
[,1] [,2] [,3]
x 1 2 3
y 10 11 12
[,1] [,2] [,3]
x 1 2 3
y 10 11
[,1] [,2] [,3]
x 1 2 3
y 4 5 6
All of the mentioned
Answer

4.
Point out the correct statement :
Character strings are entered using either matching double (“) or single (‘) quotes
Character vectors may be concatenated into a vector by the c() function
Subsets of the elements of a vector may be selected by appending to the name of the vector an index vector in square brackets
All of the mentioned
Answer

5.
The ________ function takes an arbitrary number of arguments and concatenates them one by one into character strings.
copy()
paste()
bind()
None of the mentioned
Answer

6.
What would the following code print ?
> x < 1:3
> y < 10:12
> cbind(x, y)
x y
[1,] 6 10
[2,] 7 11
[3,] 8 12
x y
[1,] 1 10
[2,] 2 11
[3,] 3 12
x y
[1,] 1 4
[2,] 2 5
[3,] 3 6
None of the mentioned
Answer

7.
What would the following code print ?
> m < 1:10
> m
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11
0 1 2 3 4 5 6 7 8 9 10
None of the mentioned
Answer

8.
What would be the output of the following code ?
> m < matrix(1:6, nrow = 2, ncol = 3)
> m
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
[,0] [,1] [,2]
[1,] 1 3 5
[2,] 2 4 6
[,1] [,2] [,3]
[1,] 1 3 6
[2,] 2 4 5
All of the mentioned
Answer

9.
What would be the output of the following code ?
> m < matrix(nrow = 2, ncol = 3)
> dim(m)
3 2
2 3
2 2
None of the mentioned
Answer

10.
Which of the following is invalid assignment ?
> m < matrix(nrow = 2, ncol = 3)
> m < matrix(nrow = 2, ncol = 3.5)
> m < mat(nrow = 2, ncol = 3)
None of the mentioned
Answer

11.
Point out the correct statement :
The elements of a logical vector cannot have the values TRUE, FALSE, and NA
Matrices are vectors with a dimension attribute
Numerical vectors are generated by conditions
All of the mentioned
Answer

12.
What would the following code print ?
> x < c("a", "b", "c")
> as.logical(x)
a b c
NA NA NA
0 1 2
All of the mentioned
Answer

13.
Point out the correct statement :
rep() is be used for replicating an object in various complicated ways
seq() function has four arguments
sequence() is a more general facility for generating sequences
All of the mentioned
Answer

14.
Which of the following statement would print “0” “1” “2” “3” “4” “5” “6” for the following code ?
> x < 0:6
as.character(x)
as.logical(x)
as.numeric(x)
None of the mentioned
Answer

15.
Which of the following is used for generating sequences ?
seq()
sequence()
order()
None of the mentioned
Answer

16.
_______ function returns a vector of the same size as x with the elements arranged in increasing order
sort()
orderasc()
orderby()
None of the mentioned
Answer

17.
Which of the following code constructs vector of length 11 ?
> v < 3*x + y + 1
> v < 3*x + y + 2
> v < 2*x + y + 1
All of the mentioned
Answer

18.
What would be the output of the following code ?
> sqrt(17)
4.02
4.02
NaN
None of the mentioned
Answer

19.
Which of the following is invalid assignment ?
> c(10.4, 5.6, 3.1, 6.4, 21.7) > x
> assign("x", c(10.4, 5.6, 3.1, 6.4, 21.7))
> x < c(10.4, 5.6, 3.1, 6.4, 21.7)
None of the mentioned
Answer

20.
Point out the correct statement :
The usual operator, <, can be thought of as a syntactic shortcut to expression operation
Assignment can also be made using the function assignment()
Vectors can be used in arithmetic expressions, in which case the operations are performed element by element
None of the mentioned
Answer