as.numeric.nonempty function

as.numeric with special handling for length 0 (NULL) objects