关于包含dplyr代码的R包knitrProgressBar合规授权的技术咨询
Great question—let’s break this down step by step to make sure your knitrProgressBar package is fully compliant with the MIT license and ready for CRAN submission.
1. Setting Up the Authors@R Field
Since you’ve adapted code from dplyr’s progress_estimated and added your own custom logic, your Authors@R needs to clearly attribute both your work and the original dplyr contributors. Here’s how to structure it:
- You go first as the creator/maintainer, using roles
aut(author) andcre(creator/maintainer). Add a comment explaining your specific contributions. - Include RStudio, PBC as a copyright holder (
cph), since they’re the primary copyright owner of dplyr. - If you can identify the specific dplyr authors who wrote the original
progress_estimatedfunction (check dplyr’s git history orAuthors@Rfor core contributors like Hadley Wickham or Romain Francois), add them as additional authors with a comment linking them to the original code.
Example Authors@R entry for your DESCRIPTION file:
Authors@R = c( person("Your Full Name", email = "your.email@example.com", role = c("aut", "cre"), comment = "Creator of knitrProgressBar; added custom decision logic and dependency-free implementation of progress_estimated"), person("RStudio, PBC", role = "cph", comment = "Original copyright holder of dplyr's progress_estimated function"), person("Hadley Wickham", role = "aut", comment = "Original contributor to dplyr's progress_estimated"), person("Romain Francois", role = "aut", comment = "Original contributor to dplyr's progress_estimated") )
If you can’t pinpoint exactly who wrote progress_estimated, you can simplify to just listing RStudio as the copyright holder—this still meets MIT’s attribution requirements.
2. Writing the LICENSE File
Since dplyr uses the MIT license, your package must also use MIT to stay compliant. Your LICENSE file needs to combine copyright notices for your original work and the adapted dplyr code, plus the standard MIT license text.
Here’s a template you can use:
YEAR: [Current Year] COPYRIGHT HOLDER: [Your Full Name] Portions of this software derive from the `progress_estimated` function in the dplyr package, which is licensed under the MIT License: YEAR: [Year dplyr first released progress_estimated (e.g., 2014)] COPYRIGHT HOLDER: RStudio, PBC and its contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3. Additional CRAN-Ready Checks
- In your DESCRIPTION file, add
License: MIT + file LICENSE(this tells CRAN to look for your LICENSE file). - Add a note in your README or package documentation (e.g., in
?knitrProgressBar) explaining the code’s origin:This package includes an adapted version of the
progress_estimatedfunction from the dplyr package (copyright RStudio, PBC and contributors), modified to be dependency-free with custom progress bar functionality tailored for knitr workflows. - If you modified the original
progress_estimatedcode, add comments in the function source noting your changes—this helps reviewers and users understand what’s been adjusted.
This setup will ensure your package is fully compliant with the MIT license, properly attributes all contributors, and meets CRAN’s submission requirements.
内容的提问来源于stack exchange,提问作者rmflight

