In R Script, I need to
- read input from command line
- check if the input is numeric or character.
- Print Error, if the input is a Character
I'm converting the input into numeric using
a = as.integer(a1)
If User has entered character, a becomes NA
When I try below
if(is.na(a) == FALSE){
cat("<b>Please enter a numeral to continue the conversation<b><br>"
)
I get a warning
Warning message: NAs introduced by coercion
is.na returns logical value, I got this confirmed using
cat(mode(is.na(a))
How do I clear this warning message?