data_replicate will fail with invalid 'times' value when only one column is left in data frame#654
data_replicate will fail with invalid 'times' value when only one column is left in data frame#654strengejacke merged 5 commits intomainfrom
invalid 'times' value when only one column is left in data frame#654Conversation
…olumn is left in data frame Fixes #652
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the data_replicate() function where it would fail with an "invalid 'times'" error when only one column remained in the data frame after removing the expand column. The fix adds the drop = FALSE parameter to prevent automatic dimension dropping during row subsetting.
- Adds
drop = FALSEto row subsetting operation to preserve data frame structure - Includes regression test to verify the fix works for single-column scenarios
- Updates version number and NEWS.md with bug fix documentation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| R/data_replicate.R | Adds drop = FALSE to prevent dimension dropping when subsetting rows |
| tests/testthat/test-data_replicate.R | Adds regression test for single-column data frame handling |
| NEWS.md | Documents the bug fix in release notes |
| DESCRIPTION | Increments version number from 1.2.0.5 to 1.2.0.6 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
etiennebacher
left a comment
There was a problem hiding this comment.
LGTM, you can merge if tests pass. Thank you
|
I added it also in two other instances. |
This comment was marked as outdated.
This comment was marked as outdated.
|
My bad, I'm wrong
This probably needs to be fixed too. |
Fixes #652