Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following R code?
> x <- 0:6
> as.logical(x)

What will be the output of the following R code?
> x <- 0:6
> as.logical(x)
a) FALSE TRUE TRUE TRUE TRUE TRUE TRUE
b) “0” “1” “2” “3” “4” “5” “6”
c) 0 1 2 3 4 5 6
d) 6 5 5 3 2 1

Answer: a
Explanation: Sometimes, R can’t figure out how to coerce an object and this can result in NAs being produced.

Join The Discussion