@@ -187,16 +187,57 @@ assert_sufficient_f_args <- function(f, ...) {
187187# ' quosure into a function; functions are returned as-is or with light
188188# ' modifications to calculate `ref_time_value`.
189189# '
190- # ' This code and documentation borrows heavily from [`rlang::as_function`]
191- # ' (https://github.com/r-lib/rlang/blob/c55f6027928d3104ed449e591e8a225fcaf55e13/R/fn.R#L343-L427).
192- # '
193190# ' This code extends `rlang::as_function` to create functions that take three
194191# ' arguments. The arguments can be accessed via the idiomatic `.`, `.x`, and
195192# ' `.y`, extended to include `.z`; positional references `..1` and `..2`,
196193# ' extended to include `..3`; and also by `epi[x]_slide`-specific names
197194# ' `.group_key` and `.ref_time_value`.
198195# '
199- # ' @source https://github.com/r-lib/rlang/blob/c55f6027928d3104ed449e591e8a225fcaf55e13/R/fn.R#L343-L427
196+ # ' @source This code and documentation are based on
197+ # ' [`as_function`](https://github.com/r-lib/rlang/blob/c55f6027928d3104ed449e591e8a225fcaf55e13/R/fn.R#L343-L427)
198+ # ' from Hadley Wickham's `rlang` package.
199+ # '
200+ # ' Below is the original license for the `rlang` package.
201+ # '
202+ # '
203+ # ' MIT License
204+ # '
205+ # ' Copyright (c) 2020 rlang authors
206+ # '
207+ # ' Permission is hereby granted, free of charge, to any person obtaining a copy
208+ # ' of this software and associated documentation files (the "Software"), to deal
209+ # ' in the Software without restriction, including without limitation the rights
210+ # ' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
211+ # ' copies of the Software, and to permit persons to whom the Software is
212+ # ' furnished to do so, subject to the following conditions:
213+ # '
214+ # ' The above copyright notice and this permission notice shall be included in all
215+ # ' copies or substantial portions of the Software.
216+ # '
217+ # ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
218+ # ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
219+ # ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
220+ # ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
221+ # ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
222+ # ' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
223+ # ' SOFTWARE.
224+ # '
225+ # '
226+ # ' Portions of the original code used in this adaptation:
227+ # ' 1. Much of the documentation and examples
228+ # ' 2. The general flow of the function, including branching conditions
229+ # ' 3. Error conditions and wording
230+ # ' 4. The chunk converting a formula into a function, see
231+ # ' https://github.com/r-lib/rlang/blob/c55f6027928d3104ed449e591e8a225fcaf55e13/R/fn.R#L411-L418
232+ # '
233+ # ' Changes made include:
234+ # ' 1. Updates to documentation due to new functionality
235+ # ' 2. The removal of function-as-string processing logic and helper arg
236+ # ' `env`
237+ # ' 3. The addition of an output function wrapper that defines a data mask
238+ # ' for evaluating quosures
239+ # ' 4. Calling an argument-checking function
240+ # ' 5. Replacing rlang error functions with internal error functions
200241# '
201242# ' @param f A function, one-sided formula, or quosure.
202243# '
0 commit comments