Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which of the following statement is invalid ?
a) x <- c(1+0i, 2+4i)
b) x <- c(TRUE, FALSE)
c) x <- c(T, F)
d) None of the mentioned

View Answer

Answer: d [Reason:] T and F are short-hand ways to specify TRUE and FALSE.

2. Point out the correct statement :
a) Use explicit TRUE and FALSE values when indicating logical values
b) rm command is used to remove objects in R
c) R operates on named data structures
d) All of the mentioned

View Answer

Answer: d [Reason:] A number occurring by itself in an expression is taken as a vector of length one.

3. What would be the result of following code ?

> x <- 6
> class(x)

a) “integer”
b) “double”
c) “real”
d) All of the mentioned

View Answer

Answer: b [Reason:] class is used to determine data type of the variable.

4. What will the following code print ?

> x <- 0:6
> as.logical(x)

a) FALSE TRUE TRUE TRUE TRUE TRUE TRUE
b) “0” “1” “2” “3” “4” “5” “6”
c) 0 1 2 3 4 5 6
d) All of the mentioned

View Answer

Answer: a [Reason:] Sometimes, R can’t figure out how to coerce an object and this can result in NAs being produced.

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

View Answer

Answer: c [Reason:] Vectors occurring in the same expression need not all be of the same length.

6. Which of the following is invalid assignment ?
a)

 > c(10.4, 5.6, 3.1, 6.4, 21.7) -> x

b)

 > assign("x", c(10.4, 5.6, 3.1, 6.4, 21.7))

c)

 > x <- c(10.4, 5.6, 3.1, 6.4, 21.7)

d) None of the mentioned

View Answer

Answer: d [Reason:] Assignments can also be made in the other direction, using the obvious change in the assignment operator.

7. What would be the output of the following code ?

 > sqrt(-17)

a) -4.02
b) 4.02
c) NaN
d) None of the mentioned

View Answer

Answer: c [Reason:] These metadata can be very useful in that they help to describe the object.

8. Which of the following code constructs vector of length 11 ?
a)

 > v <- 3*x + y + 1

b)

 > v <- 3*x + y + 2

c)

 > v <- 2*x + y + 1

d) All of the mentioned

View Answer

Answer: c [Reason:] The elementary arithmetic operators are the usual +, -, *, / and ^ for raising to a power.

9. _______ function returns a vector of the same size as x with the elements arranged in increasing order
a) sort()
b) orderasc()
c) orderby()
d) none of the mentioned

View Answer

Answer: a [Reason:] There are other more flexible sorting facilities available like order() or sort.list() which produce a permutation to do the sorting.

10. Which of the following is used for generating sequences ?
a) seq()
b) sequence()
c) order()
d) none of the mentioned

View Answer

Answer: a [Reason:] R has a number of facilities for generating commonly used sequences of numbers.

Synopsis and Project Report

You can buy synopsis and project from distpub.com. Just visit https://distpub.com/product-category/projects/ and buy your university/institute project from distpub.com