Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

I need a R function called isBinary that accepts a single argument called x .

isBinaryxTRUExFALSE isBinary function to now have arguments (x, allow.NA = FALSE) that has the following behaviour:

  1. If allow.NA is TRUE, your function should return TRUE if the elements of x are 0, 1 or NA. It should return FALSE otherwise.
  2. If allow.NA is FALSE your function should behave exactly as in (a). i.e., the function should return TRUE if and only if the elements of x are 0 or 1.
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question