Question
> printmessage2 <- function(x) {
+ if(is.na(x))
+ print("x is a missing value!")
+ else if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage2(NA)
a.
“x is a missing value!”
b.
“x is greater than zero”
c.
“x is less than or equal to zero”
d.
Error
Posted under R Programming
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. What will be the value of following R expression?
View solution
Q. Point out the correct statement?
View solution
Q. Which of the following is valid body of split function?
View solution
Q. The _____ function takes a vector or other objects and splits it into groups determined by a factor or list of factors.
View solution
Q. Point out the correct statement?
View solution
Q. Point out the wrong statement?
View solution
Q. Body of lapply function is?
View solution
Q. lappy functions takes _________ arguments in R language.
View solution
Q. _______ is used to apply a function over subsets of a vector.
View solution
Q. ________ applies a function over the margins of an array.
View solution
Q. Point out the correct statement?
View solution
Q. Which of the following is multivariate version of lapply?
View solution
Q. __________ function is same as lapply in R.
View solution
Q. Point out the wrong statement?
View solution
Q. ________ loop over a list and evaluate a function on each element.
View solution
Q. The _________ function is used to plot negative likelihood.
View solution
Q. Point out the correct statement?
View solution
Q. _________ require you to pass a function whose argument is a vector of parameters.
View solution
Q. Which of the following language supports lexical scoping?
View solution
Q. Point out the wrong statement?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond R Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Cyber Security
Understand the fundamentals of safeguarding digital assets with our Cyber Security...
Software Engineering
Learn about the systematic approach to developing software with our Software...