T Tam ca New member Sep 20, 2021 #1 What will be the output of the following R code? Code: x<- c (“a”,” b”) as.numeric(x) A. [1] 1 2 B. [1] TRUE TRUE C. [1] NA NA (Warning message: NAs introduced by coercion) D. [1] NAN
What will be the output of the following R code? Code: x<- c (“a”,” b”) as.numeric(x) A. [1] 1 2 B. [1] TRUE TRUE C. [1] NA NA (Warning message: NAs introduced by coercion) D. [1] NAN
Nguyễn Nguyệt Ánh New member Sep 20, 2021 #2 Answer: c Explanation: Characters cannot be expressed as numeric. Therefore NA’s are printed as output. NA will specify the missing elements in the list. When nonsensical coercion takes place, you will usually get a warning from R. Upvote 0 Downvote
Answer: c Explanation: Characters cannot be expressed as numeric. Therefore NA’s are printed as output. NA will specify the missing elements in the list. When nonsensical coercion takes place, you will usually get a warning from R.