adplus-dvertising
frame-decoration

Question

What will be the output of the following R 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.

Null

Posted under R Programming

Answer: (a).Error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following R code?

Similar Questions

Discover Related MCQs

Q. To get the current date, the _______ function will return a Date object which can be converted to a different class if necessary.

Q. Point out the correct statement?

Q. Warnings are generated by the _________ function.

Q. Point out the correct statement?

Q. _________ is an indication that a fatal problem has occurred and execution of the function stops.

Q. A programmer builds a _________ to avoid repeating the same task or reduce complexity.

Q. The cumulative frequency distribution of a categorical variable can be checked using the ________ function in R language.

Q. Which function calculates the count of each category of a categorical variable?

Q. Which function basically finds the intersection between two different sets of data?

Q. _________ package provides basic functionalities in R environment like arithmetic calculations, input/output.

Q. Write a function to extract the first name in the string “Mrs. Jake Luther”?

Q. ________ function generates “n” normal random numbers based on the mean and standard deviation arguments passed to the function.

Q. What will be the output of runif()?

Q. Write the syntax to set the path of the current working directory in R environment?

Q. Which function is used to create a histogram for visualisation in R programming language?

Q. Which function helps you perform sorting in R language?

Q. The current user defined objects like lists, vectors, etc. is referred to as __________ in the R language.

Q. A ________________ in R programming language can also contain numeric and alphabets along with special characters like dot and underline.

Q. ___________ function gives an error message if the desired package cannot be loaded.

Q. ________ function is usually used inside another function and throws a warning whenever a particular package is not found.