Skip to content
Prev 8865 / 63424 Next

R/S indexing difference

Is this intentional?

R:
[1] -4  2 -6  4  5  6  7

so NAs are treated as FALSE

S+6.1:
Warning messages:
  Replacement length not a multiple of number of elements to
	replace in: x[c(1, NA, 3)] <-  - (4:6)
[1] -4  2 -5  4  5  6  7

and NAs are ignored.