docs: fix shift.Rd Value section to reflect vector return for single n#7780
Closed
LeonidasZhak wants to merge 1 commit into
Closed
docs: fix shift.Rd Value section to reflect vector return for single n#7780LeonidasZhak wants to merge 1 commit into
LeonidasZhak wants to merge 1 commit into
Conversation
The Value section previously stated 'A list containing the lead/lag of input x', but shift() returns a vector (not a list) when x is atomic and length(n) == 1. This is confirmed by src/shift.c:181: if (isVectorAtomic(obj) && length(ans) == 1) ans = VECTOR_ELT(ans, 0); The inaccurate Value section could confuse Stata migrants expecting consistent return types from lag/lead operations.
Author
|
I am withdrawing this PR as part of a broader cleanup of an oversized automated contribution batch. I am sorry for the review noise and the pressure this may have put on maintainers. Going forward I will keep contributions to this project much more limited and higher-signal, ideally only one or two focused PRs at a time. Thank you for maintaining the project. |
Member
|
@LeonidasZhak please read our contribution guidelines regarding the use of AI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixed the Value section of
shift.Rdto accurately describe the return type behavior.Problem
The Value section stated:
But
shift()returns a vector (not a list) whenxis atomic andlength(n) == 1. This is confirmed bysrc/shift.c:181:The Details section already documented this behavior correctly, but the Value section was inaccurate.
Fix
Updated the Value section to:
Stata migration relevance
This fix is particularly important for Stata migrants who expect consistent return types from lag/lead operations. Stata's
L.varalways returns a vector, and the inaccurate Value section could lead users to believeshift()always returns a list, causing unexpected behavior in their code.Validation
tools::checkRd('man/shift.Rd')passes (no errors)Duplicate check