-
Notifications
You must be signed in to change notification settings - Fork 102
Documentation fixes for paste.Rd and substr.Rd #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The bullet-point list mentions 'Explained recycle0 behavior when collapse is specified.' for paste.Rd but as far as I can tell, you did not change the explanation about recycle0? |
|
The examples added to substr.Rd are useful, but the comment '## Demonstrating zero-length extraction behavior' is misleading: 'character(0)' in the first example indeed is zero-length, but '""' in the second example has length 1, even though it contains zero characters: length("") == 1 but nchar("") == 0. |
|
Hi Sir Thanks for your feedback! I apologize for not including the changes you suggested in my previous commit , I realized after pushing that I had only partially staged the updates, so the examples and comments weren’t fully updated. I’ve now incorporated your suggestions: Both changes are included in the latest commit. PTAL , thanks! |
|
No problem! However, I would not add the examples in paste.Rd, since there are already examples showing the use of 'collapse' and 'recycle0' (below the headings ## 'recycle0 = TRUE' and '## When 'collapse = '). |
|
Thanks for the clarification! No new examples are added now, and the documentation remains unchanged functionally. Please let me know if this looks good or if you’d prefer a different approach. |
|
Looks good to me, but you'll have to wait for a response of one of the R maintainers. I'm just a fellow-coder who saw your remark in the R-contributers Slack. |
|
Thanks for taking a look and for the helpful guidance! |
This PR includes minor documentation improvements to base R functions:
1. paste.Rd
• Clarified why paste0() is slightly more efficient than paste().
• Explained recycle0 behavior when collapse is specified.
2. substr.Rd
• Added a note about zero-length extraction: when start or stop results in zero-length, an empty string "" is returned.
• Updated examples to demonstrate zero-length behavior.
These changes improve clarity for users reading the documentation, without modifying any code behavior.