• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in R Language by
Q:

What will be the output of the below code -

printmessage <- function (a) {

                  if (is.na (a))

                             print ("a is a missing value!")

                     else if (a < 0)

                             print ("a is less than zero")

                     else

                            print ("a is greater than or equal to zero")

                    invisible (a)

 }

printmessage (NA)

1 Answer

0 votes
by
The output for the above R programming code will be “a is a missing value.” The function is.na () is used to check if the input passed is a missing value.

Related questions

+2 votes
asked Jul 28, 2019 in R Language by Aarav2017
+2 votes
asked Jul 28, 2019 in R Language by Aarav2017
...