Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204798

Control order of result from approx()

$
0
0

Both approx(c(-10, 0), c(-10, 0), n = 3) and approx(c(0, -10), c(0, -10), n = 3) yield the same result, but I feel the second one should return points from (0, 0) to (-10, -10) in that order (i.e. the reverse of what is returned).

Does anyone know the rationale behind the reordering of these results and does anyone have an elegant way of ensuring the ordering matches the input arguments?

To clarify, I would like approx(c(0, -10), c(0, -10), n = 3)$x to give the result 0 -5 -10 and not -10 -5 0 as is the actual case.


Viewing all articles
Browse latest Browse all 204798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>