Which R one? The R Python one is totally wrong. The first R example containing NaN is right (according to my machine), but the argument makes no sense. The second R example containing NaN maybe causes ChatGPT to not terminate?