Skip to content

Try adding pattern to replications targets#4

Open
psychelzh wants to merge 2 commits intomainfrom
use-dynamic
Open

Try adding pattern to replications targets#4
psychelzh wants to merge 2 commits intomainfrom
use-dynamic

Conversation

@psychelzh
Copy link
Owner

This is used to fix #3.

@psychelzh psychelzh requested a review from Copilot September 14, 2025 02:12
@psychelzh psychelzh self-assigned this Sep 14, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the permutation testing infrastructure to support pattern-based replication, addressing issue #3. The changes migrate from using tarchetypes::tar_rep_raw() to a custom pattern-based approach for better integration with the targets workflow.

  • Adds pattern support to tar_cluster_permutation() and tar_mantel() functions
  • Replaces batch-based permutation with a custom run_rep_df() function that generates replications as list columns
  • Updates target calls to use the new pattern-based approach with increased default replications (1000 vs previous 10)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
_targets.R Adds pattern and iteration parameters to specific targets using the new replication system
R/tar_factories.R Major refactor of permutation functions to support pattern-based replication with new run_rep_df() helper
R/clusters.R Updates default column identifier for permuted data from starts_with("tar") to .rep

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@psychelzh
Copy link
Owner Author

In fact, I must use "list" iteration in some places, which adds complexity to the issue. So, we might suspend this case for now.

@psychelzh psychelzh changed the title Try to add pattern to replications targets Try adding pattern to replications targets Sep 15, 2025
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.

Performance related: {targets} package tar_rep() cannot use dynamic pattern

2 participants