in R Language by

What will be the output of the below code -

printmessage <- function (a) {

                  if ( (a))

                             print ("a is a missing value!")

                     else if (a < 0)

                             print ("a is less than zero")


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

                    invisible (a)


printmessage (NA)

1 Answer

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