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. _________ is an indication that a fatal problem has occurred and execution of the function stops
a) message
b) error
c) warning
d) all of the mentioned

View Answer

Answer: b [Reason:] Errors are produced by the stop() function.

2. Point out the correct statement :
a) R has a number of ways to indicate to you that something’s not right
b) Executing any function in R may result in the condition
c) “condition” is a generic concept for indicating that something unexpected has occurred
d) All of the mentioned

View Answer

Answer: d [Reason:] Programmers can create their own custom conditions if they want.

3. What would be the value of following expression ?

 log(-1)

a) Warning in log(-1): NaNs produced
b) 1
c) Null
d) 0

View Answer

Answer: a [Reason:] This warning lets you know that taking the log of a negative number results in a NaN value because you can’t take the log of negative numbers.

4. Warnings are generated by the _________ function
a) warning()
b) error()
c) run()
d) none of the mentioned

View Answer

Answer: a [Reason:] warning is an indication that something is wrong but not necessarily fatal; execution of the function continues.

5. Point out the correct statement :
a) POSIX represents a portable operating system interface, primarily for UNIX systems
b) There are different levels of indication that can be used, ranging from mere notification to fatal error
c) The default input format for POSIX dates consists of the month, followed by the year and day, separated by slashes or dashes
d) None of the mentioned

View Answer

Answer: a [Reason:] Dates stored in the POSIX format are date/time values (like dates with the chron library), but also allow modification of time zones.

6. What will be the output of the following code ?

> printmessage <- function(x) {
+ if(x > 0)
+         print("x is greater than zero")
+ else
+         print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(1)

a) Error
b) Warning
c) Messages
d) All of the mentioned

View Answer

Answer: a [Reason:] The function seems to work fine. No errors, warnings, or messages.

7. To get the current date, the _______ function will return a Date object which can be converted to a different class if necessary.
a) Sys.Time
b) Sys.Date
c) Sys.DateTime
d) All of the mentioned

View Answer

Answer: b [Reason:] The POSIXlt class stores date/time values as a list of components (hour, min, sec, mon, etc.) making it easy to extract these parts.

8. Which of the followin code represents internal representation of a Date object ?
a) class(as.Date(“1970-01-02”))
b) unclass(as.Date(“1970-01-02”))
c) unclassint(as.Date(“1970-01-02”))
d) all of the mentioned

View Answer

Answer: b [Reason:] You can see the internal representation of a Date object by using the unclass() function.

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

> x <- as.Date("1970-01-01")
> x

a) “1970-01-01”
b) “1970-01-02”
c) “1970-02-01”
d) none of the mentioned

View Answer

Answer: a [Reason:] Dates are represented by the Date class and can be coerced from a character string using the as.Date() function.

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

> printmessage <- function(x) {
+ if(x > 0)
+         print("x is greater than zero")
+ else
+         print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(NA)

a) Error
b) Warning
c) Messages
d) All of the mentioned

View Answer

Answer: a [Reason:] You can’t do that test if x is a NA or NaN value.

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