Displaying 1 result from an estimated 1 matches for "integeroneindex".
2018 Jul 03
0
Inconsistencies when extracting with non-integer numeric indices near zero
...also differs between [ and [[ :
c(1,2)[as.integer(.5)] --> numeric(0) # As expected
c(1,2)[.5] --> numeric(0) # As expected
c(1,2)[[as.integer(.5)]] --> Error in c(1, 2)[[as.integer(0.5)]] : attempt to select less than one element in integerOneIndex # Also as expected
c(1,2)[[.5]] --> [1] 1 # Not so expected
c(1,2)[[1.5]] --> [1] 1 # As expected, but this also means somevector[[n]] and somevector[[n+1]] give back the same element for 0<n<1
c(1,2)[[as.in...