Avoid overwriting dyad IDs named n_members during incomplete-dyad checks
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Domain
- data
Research direction
Start at R/validate_dyad_data.R in resolve_incomplete_dyads() (linked lines 497-526) and see where the internal n_members count column is created and later used to drop dyads. Run the reproduction via prepare_dyad_data() to confirm the wrong retained and recorded IDs, then give the temporary count a reserved name that a user ID can never collide with. Done means the reproduction returns c(20,20,30,30), plus new testthat tests covering a >2-member dyad with ID column n_members and confirming other ID names still work.
Written by the indexing model from the issue text.
Description
Problem
resolve_incomplete_dyads() creates a summary column named n_members. If the user's dyad ID column has that valid name, counts overwrite the IDs and are then used to drop dyads (source).
This can retain incomplete dyads despite incomplete_dyads = "drop" and record the wrong dropped IDs.
Reproduction
dat <- data.frame(
n_members = c(10, 20, 20, 30, 30),
person = c(1, 1, 2, 1, 2)
)
out <- dyadMLM::prepare_dyad_data(
dat, dyad = n_members, member = person,
incomplete_dyads = "drop", seed = 1
)
out$n_members
Expected: c(20, 20, 30, 30). Instead, count 1 becomes the incomplete dyad ID. The code tries to drop absent ID 1 and retains incomplete dyad 10.
Fix
- Give the internal count a reserved temporary-column name that cannot overwrite a user's ID column.
- Test retained rows and the recorded dropped ID through
prepare_dyad_data(). - Also test a dyad with more than two members when the ID column is
n_members. Confirm other ID names still work.
Keep statistical formulas and function arguments unchanged.
Reproduced on 2026-09-10 at c92eb46, including the wrong recorded dropped ID.
Related: #33.
- Dominant language
- R
- Stars
- 1
- Forks
- 2
- Avg merge
- 1d 41m
- Merged PRs (30d)
- 31
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Pascal-Kueng/dyadMLM
-
documentation good first issue priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Pascal-Kueng/dyadMLM#92 ·
Maintainers usually reply within 1 day
-
documentation enhancement good first issue priority: low
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Pascal-Kueng/dyadMLM#71 · 3 comments ·
Maintainers usually reply within 1 day
-
documentation enhancement good first issue priority: low
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Pascal-Kueng/dyadMLM#70 ·
Maintainers usually reply within 1 day
-
documentation enhancement priority: low
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Pascal-Kueng/dyadMLM#69 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation enhancement good first issue priority: low
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Pascal-Kueng/dyadMLM#68 ·
Maintainers usually reply within 1 day
All issues in Pascal-Kueng/dyadMLM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nmfs-ost/stockplotr#445 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Importer: an empty or non-numeric Error cell is imported as 0 instead of missingPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Open-Systems-Pharmacology/OSPSuite.Core#3049 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
NovoNordisk-OpenSource/mighty#88 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
petal-code/helios#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100