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. R has how many atomic classes of objects ?
a) 1
b) 2
c) 3
d) 5

Answer: d [Reason:] The most basic type of R object is a vector.

2. Point out the correct statement :
a) Empty vectors can be created with the vector() function
b) A sequence is represented as a vector but can contain objects of different classes
c) “raw” objects are commonly used directly in data analysis
d) None of the mentioned

Answer: a [Reason:] A vector can only contain objects of the same class.

3. Numbers in R are generally treated as _______ precision real numbers.
a) single
b) double
c) real
d) all of the mentioned

Answer: b [Reason:] This means that even if you see a number like “1” or “2” in R, which you might think of as integers, they are likely represented behind the scenes as numeric objects something like “1.00” or “2.00”.

4. If you explicitly want an integer, you need to specify the _____ suffix.
a) D
b) R
c) L
d) All of the mentioned

Answer: c [Reason:] Entering 1 in R gives you a numeric object; entering 1L explicitly gives you an integer object.

5. Point out the correct statement :
a) The value NaN represents undefined value
b) Number Inf represents infinity in R
c) NaN can also be thought of as a missing value
d) All of the mentioned

Answer: b [Reason:] This allows us to represent entities like 1 / 0.

6. Attributes of an object (if any) can be accessed using the ______ function.
a) objects()
b) attrib()
c) attributes()
d) all of the mentioned

Answer: c [Reason:] Not all R objects contain attributes, in which case the attributes() function returns NULL.

7. R objects can have attributes, which are like ________ for the object.
b) features
c) expression
d) none of the mentioned

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

8. Which of the following can be considered as object attribute ?
a) dimensions
b) class
c) length
d) all of the mentioned

Answer: d [Reason:] All objects in R have an Attribute list.

9. What would be the result of following code ?

```> x <- vector("numeric", length = 10)
> x```

a) 10
b) 0 0 0 0 0 0 0 0 0 0
c) 01
d) None of the mentioned

Answer: b [Reason:] You can also use the vector() function to initialize vectors.

10. The ___ function can be used to create vectors of objects by concatenating things together.
a) cp()
b) c()
c) concat()
d) none of the mentioned