Skip to content

Commit

Permalink
Streamline steps go from 0 to N
Browse files Browse the repository at this point in the history
  • Loading branch information
eliocamp committed Oct 14, 2024
1 parent fb6d843 commit 609dd18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions R/geom_streamline.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
}

Expand Down

0 comments on commit 609dd18

Please sign in to comment.