From 609dd186d8b368b5d8ce13a2d5116922da6a3910 Mon Sep 17 00:00:00 2001 From: Elio Campitelli Date: Mon, 14 Oct 2024 16:40:42 +1100 Subject: [PATCH] Streamline steps go from 0 to N --- NEWS.md | 1 + R/geom_streamline.R | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index a8910d15..b7838627 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,7 @@ - The `GetSMNData()` function is defunct. The functionality is a hack and hard to maintain and it's also very specific and should be out of scope for a general package. - The `trans` argument of scales has been renamed to `transform` following ggplot2's change. - `scale_mag()` internals are now much simpler and inherits all the functionality from common continuous scales. (thanks @teunbrand for the suggestion, #186) +- The `step` computed variable in `geom_streamline()` now goes from 0 to the total number of steps instead of from negative half to positive half. # metR 0.15.0 diff --git a/R/geom_streamline.R b/R/geom_streamline.R index d958982e..9208c384 100644 --- a/R/geom_streamline.R +++ b/R/geom_streamline.R @@ -545,6 +545,7 @@ streamline.f <- function(field, dt = 0.1, S = 3, skip.x = 1, skip.y = 1, nx = NU points[, group := interaction(group, piece, end)] points[, line := group] + points[, step := seq(0, .N), by = .(group)] return(points[, .(x, y, group, piece, end, step, dx, dy, line)]) }