Skip to content

usedID runs before ID_twin1 #126

Description

@smasongarrison

In makeTwins(), usedID <- c(usedID, ID_twin1) runs before ID_twin1 is sampled, so usedID includes NA on the first iteration. That makes the filter !(ped$ID %in% usedID) evaluate to NA for all IDs (because %in% with NA yields NA), which can cause resample() to see NA candidates and fail or behave unpredictably. Only append ID_twin1 to usedID after it has a non-NA value (or drop NAs from usedID before using it in %in%).

Originally posted by @Copilot in #115

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions