thomasp85 / particles

A particle simulation engine based on a port of d3-force
Other
118 stars 9 forks source link

Warning in `velocity_constraint` #10

Closed Waschina closed 1 year ago

Waschina commented 2 years ago

Wit new R Versions (>= 4.2.0), the method apply_constraint.velocity_constraint causes the warning:

In min_constrained || max_constrained : 'length(x) = 13 > 1' in coercion to 'logical(1)'

The cause is a new handling of logical expression containing && or ||. A warning is returned if at least one of the left or right argument has a length > 1.

Minimal example to trigger the warning:

a <- c(0,1)
b <- c(2,0)

a > b | a > 0
a > b || a > 0
thomasp85 commented 1 year ago

Thank you!