Lesson - 2A3

Nonsensical coercion - is when R can not represent the data as requested by the operator - 
The represented data is represented as non-applicable NA for the values in said object - 

I
n the examples below concatenating characters into numerical objects would be nonsensical coercion and will display the characters as NA  -

ie:

x <- c("a", "b", "c", "d")

as.character(x)

"a" "b" "c" "d"

 - Being these are already characters there is no errors -

as.numeric(x)

NA NA NA NA

Warning message:
NAs introduced by coercion

The above is producing an error because there are no conversions associate to character to numeric, even when using as.integer(x)

Comments