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

Prevent pool names from combining groups that should stay separate

Open Beginner friendly
#60 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
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
r
Domain
data

Research direction

Start at the name check in R/data_prep_compositions.R (around line 497) and read how composition labels are generated for individual roles after that check, so you can see which labels the check misses. Reproduce the issue with the exact example in the issue body, then add the conflict validation before indicator columns are created so it raises a clear error asking for a different pool name. Add a test for the example, plus one confirming ordinary pooling still yields separate indicators; done when the example errors and both tests pass.

Written by the indexing model from the issue text.

Description

bug good first issue priority: medium

prepare_dyad_data() lets users pool dyad compositions, meaning that selected types of dyads are treated as one group.

Some pool names cause an unrelated group to be included in the same generated model column. This happens without an error or warning and can make a fitted model treat groups as equal when the user intended to keep them separate.

For example, suppose the data contain A/B, C/C, and D/D dyads. The user pools C/C and D/D and calls that pool A_x_B_A. The package then gives the pooled members the same indicator as role A in the unpooled A/B dyads. An indicator is a column containing 1 for rows in a group and 0 for other rows.

Example

dat <- data.frame(
  dyad = rep(1:3, each = 2),
  member = rep(1:2, 3),
  role = c("A", "B", "C", "C", "D", "D"),
  x = 1:6
)

prepared <- dyadMLM::prepare_dyad_data(
  dat, dyad, member,
  role = role,
  predictors = x,
  pool_compositions = list(
    A_x_B_A = c("C-C", "D-D")
  ),
  seed = 1
)

as.data.frame(prepared)[, c(
  "dyad", "role", ".composition_role", ".is_A_x_B_A"
)]

.is_A_x_B_A is 1 for both the A member of the A/B dyad and every member of the pooled C/C and D/D dyads.

Expected behavior

Stop with a clear error explaining that the pool name conflicts with another generated group label, and ask the user to choose a different name.

Suggested fix and checks

The current name check checks existing composition names but misses labels subsequently created for individual roles.

  • Check for this conflict before creating the indicator columns.
  • Add a test for the example above.
  • Confirm that ordinary pooling still produces separate indicators for groups that were not pooled.

Keep the existing naming scheme and statistical calculations unchanged.

Dominant language
R
Stars
1
Forks
2
Avg merge
9h 28m
Merged PRs (30d)
21

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.