[Rd] How to redefine `require' to generate a warning and delegate work to the original require?

Grant Rettke gcr at wisdomandwonder.com
Sun Aug 10 20:57:04 CEST 2014


Jeroen, my sincere apologies.

Having read http://www.r-project.org/posting-guide.html I had
determined that my question was specifically "discussion about code
development in R" and was not in the realm of those who "want to use R
to solve problems but who are not necessarily interested in or
knowledgeable about programming".

As such, I posted it here.

Where did I go wrong?

Thanks for letting me know on both parts and have a great day.
Grant Rettke | ACM, ASA, FSF, IEEE, SIAM
gcr at wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Sun, Aug 10, 2014 at 1:14 PM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote:
> On Sun, Aug 10, 2014 at 7:22 PM, Grant Rettke <gcr at wisdomandwonder.com> wrote:
>>
>> │ Error in gcr$original.require(...) <- require :
>> │   '...' used in an incorrect context
>
> I think you mean: gcr$original.require <- base::require. You don't
> need the parentheses since you are not defining or calling a function.
> You are simply assigning an object to another environment.
>
> Basic questions about R usage/syntax like these are better suited for
> the r-help list or stack-overflow. Have a look at:
> https://stat.ethz.ch/mailman/listinfo/r-devel.



More information about the R-devel mailing list