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

From: Joshua Wiley <jwiley.psych_at_gmail.com>
Date: Sun, 29 May 2011 13:00:50 -0700

Hi Marco,

I am sure theoretically it would be possible to make it so that copies could not be made of base (or core) functions, but users will always be able to shoot themselves in the foot if they try hard enough. I think the usual recommendation is just not to use common function names for your own functions/data.

If you write scripts instead of just directly using the console, you do not need to save the workspace, which mitigates a whole slew of potential things you did at some prior time and have long since forgotten biting you in the posterior. You can still save data, but by using clean sessions, you are more aware of what has been done.

Cheers,

Josh

On Sun, May 29, 2011 at 12: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.
>

-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

______________________________________________
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.
Received on Sun 29 May 2011 - 20:02:29 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 29 May 2011 - 21:00:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive