Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Avoid overwriting dyad IDs named n_members during incomplete-dyad checks

Closed Beginner friendly
#31 0 comments 0 reactions 0 assignees View on GitHub

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

bug good first issue priority: medium

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Pascal-Kueng/dyadMLM

All issues in Pascal-Kueng/dyadMLM

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.