[R] Why do not prevent users from creating a local copy of c() ?

jim holtman jholtman at gmail.com
Sun May 29 22:00:04 CEST 2011


There is no way to prevent a user from messing up.  No matter how many
things you put in to prevent such occurances, I have always found that
users find new ways to use your system that you never considered.

There is always the 'conflicts()' function that might help:

> # create my 'c'
> c <- function(x) x
> conflicts()
[1] "body<-"  "c"       "setwd"   "summary"
>



On Sun, May 29, 2011 at 3:20 PM, Marco Barbàra <jabbba at gmail.com> wrote:
> Hi all,
>
> sometime in the past I accidentaly created a copy of the c()
> primitive function inside my ``laboratory'' workspace, which I
> normally use to experiment and learn. As a consequence, c() stopped to
> work correctly and started to return lists of symbols instead of
> vectors, and today I had to spend much time to seek out that the problem
> was in that specific workspace (if only I had known in advance ... ).
>
> The weird thing is that if I now recreate a local copy of c(), the
> function does continue to work correctly.
>
> Anyway, my question is: could be possible to prevent users from doing
> such dangerous things?
>
> Thanks, Marco.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?



More information about the R-help mailing list