Skip to content

fl_valley_join(): return the owning segment in nearest - #90

Merged
NewGraphEnvironment merged 1 commit into
mainfrom
89-fl-valley-join-return-seg
Oct 17, 2026
Merged

NewGraphEnvironment merged 1 commit into
mainfrom
89-fl-valley-join-return-seg

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

fl_valley_join()'s nearest gains seg: the row of segments that owns each cell, placed after dist. The value was already computed for the flag copy and dropped. With it a consumer joins any per-segment value to the floodplain cells it owns (a 0–1 habitat grade, a length), where cols carries logical flags only. any, ties and check are unchanged.

Fixes #89. Consumer: knowledge#57 phase 4 (graded floodplain hectares).

Changes

  • R/fl_valley_join.R: nearest$seg <- o$seg[first]; the return documentation names it.
  • tests/testthat/test-fl_valley_join.R: the three expect_named lines on nearest; a new test that seg indexes the segment whose flag nearest copied and that a numeric value joins through it (50 cells at 0.2, 50 at 0.9 on the two-group fixture).
  • NEWS.md: a development-version entry.

Test plan

  • devtools::test(filter = "fl_valley_join"): 0 failures, 123 passes
  • devtools::document() clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01KHMvZqDLb3LsF6tCGR13aJ

nearest gains seg, the row of segments that owns each cell, after dist. It
was computed and dropped; with it a consumer joins any per-segment value (a
0-1 grade, a length) to the cells it owns, where cols carries flags only.
any is unchanged. Fixes #89.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KHMvZqDLb3LsF6tCGR13aJ
@NewGraphEnvironment
NewGraphEnvironment merged commit b2b9c7d into main Oct 17, 2026
1 check passed
@NewGraphEnvironment
NewGraphEnvironment deleted the 89-fl-valley-join-return-seg branch October 17, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fl_valley_join(): return the owning segment in nearest

1 participant