Re: [R] Does R have a const object?

2011-03-16 Thread Michael Friendly
On 3/15/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! Although there is almost never a No in R

Re: [R] Does R have a const object?

2011-03-16 Thread Dieter Menne
Michael Friendly wrote: This is just the flexibility of R. I've just discovered a new class of geometries based on pi - 2.3 ?Constants This is a must-fortune. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Does-R-have-a-const-object-tp3356972p3381748.html

Re: [R] Does R have a const object?

2011-03-16 Thread Allan Engelhardt
On 16/03/11 13:04, Michael Friendly wrote: On 3/15/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks

Re: [R] Does R have a const object?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 10:54 AM, Allan Engelhardt all...@cybaea.com wrote: On 16/03/11 13:04, Michael Friendly wrote: On 3/15/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want

Re: [R] Does R have a const object?

2011-03-16 Thread Allan Engelhardt
On 16/03/11 15:04, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 10:54 AM, Allan Engelhardtall...@cybaea.com wrote: [...] Yes, but you can still print(base::pi) and rm(pi) to get back to our flat world, and you can't assign(pi, 4, pos = package:base) Error in assign(pi, 4, pos =

Re: [R] Does R have a const object?

2011-03-16 Thread luke-tierney
Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly more, will start signaling warnings in the near future. Doing this may be useful at times for debugging but it can mess up assumptions others make about how

Re: [R] Does R have a const object?

2011-03-16 Thread Henrik Bengtsson
On Wed, Mar 16, 2011 at 6:04 AM, Michael Friendly frien...@yorku.ca wrote: On 3/15/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being

Re: [R] Does R have a const object?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 11:49 AM, luke-tier...@uiowa.edu wrote: Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly more, will start signaling warnings in the near future.  Doing this may be useful at times

Re: [R] Does R have a const object?

2011-03-16 Thread luke-tierney
On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM, luke-tier...@uiowa.edu wrote: Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPECIAL functions, and possibly more, will start signaling warnings in the

Re: [R] Does R have a const object?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 12:16 PM, luke-tier...@uiowa.edu wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM,  luke-tier...@uiowa.edu wrote: Just as a heads-up: it is likely that unlocking the bindings in base for pi, T, F, probably all BULTIN and SPECIAL

Re: [R] Does R have a const object?

2011-03-16 Thread Barry Rowlingson
On Wed, Mar 16, 2011 at 4:16 PM, luke-tier...@uiowa.edu wrote: That would defeat the purpose.  Unlocking things in base may be useful for experimenting or debugging but it is not a good idea otherwise. You are making experimenting in R more awkward? Then I'm throwing That would defeat the

Re: [R] Does R have a const object?

2011-03-16 Thread luke-tierney
On Wed, 16 Mar 2011, Barry Rowlingson wrote: On Wed, Mar 16, 2011 at 4:16 PM, luke-tier...@uiowa.edu wrote: That would defeat the purpose.  Unlocking things in base may be useful for experimenting or debugging but it is not a good idea otherwise. You are making experimenting in R more

Re: [R] Does R have a const object?

2011-03-16 Thread luke-tierney
On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 12:16 PM, luke-tier...@uiowa.edu wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM,  luke-tier...@uiowa.edu wrote: Just as a heads-up: it is likely that unlocking the bindings in

Re: [R] Does R have a const object?

2011-03-16 Thread Hadley Wickham
Its useful for being able to set defaults for arguments that do not have defaults.  That cannot break existing programs. Until the next program decides do co change those defaults and either can't or does and you end up with incompatible assumptions.  It also make the code with the added

Re: [R] Does R have a const object?

2011-03-16 Thread Gabor Grothendieck
On Wed, Mar 16, 2011 at 1:12 PM, luke-tier...@uiowa.edu wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 12:16 PM,  luke-tier...@uiowa.edu wrote: On Wed, 16 Mar 2011, Gabor Grothendieck wrote: On Wed, Mar 16, 2011 at 11:49 AM,  luke-tier...@uiowa.edu wrote:

Re: [R] Does R have a const object?

2011-03-16 Thread Allan Kamau
. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Uwe Ligges Sent: Tuesday, March 15, 2011 2:23 PM To: xiagao1982 Cc: r-help Subject: Re: [R] Does R have a const object? On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R

[R] Does R have a const object?

2011-03-15 Thread xiagao1982
Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! xiagao1982 2011-03-15 [[alternative HTML version deleted]] __ R-help@r

Re: [R] Does R have a const object?

2011-03-15 Thread Uwe Ligges
On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! Although there is almost never a No in R, the best short answer is: No. Best, Uwe

Re: [R] Does R have a const object?

2011-03-15 Thread Duncan Murdoch
On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! Although there is almost never a No in R

Re: [R] Does R have a const object?

2011-03-15 Thread Martin Morgan
On 03/15/2011 11:34 AM, Duncan Murdoch wrote: On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks

Re: [R] Does R have a const object?

2011-03-15 Thread Gabor Grothendieck
On Tue, Mar 15, 2011 at 10:53 AM, xiagao1982 xiagao1...@gmail.com wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified unintentionally. Thanks! LockBinding will prevent a variable from being

Re: [R] Does R have a const object?

2011-03-15 Thread Uwe Ligges
On 15.03.2011 19:35, Martin Morgan wrote: On 03/15/2011 11:34 AM, Duncan Murdoch wrote: On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant

Re: [R] Does R have a const object?

2011-03-15 Thread Duncan Murdoch
On 15/03/2011 2:35 PM, Martin Morgan wrote: On 03/15/2011 11:34 AM, Duncan Murdoch wrote: On 15/03/2011 2:23 PM, Uwe Ligges wrote: On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames

Re: [R] Does R have a const object?

2011-03-15 Thread rex.dwyer
Sent: Tuesday, March 15, 2011 2:23 PM To: xiagao1982 Cc: r-help Subject: Re: [R] Does R have a const object? On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set some data frames as constant to avoid being modified

Re: [R] Does R have a const object?

2011-03-15 Thread Thomas Lumley
-help-boun...@r-project.org] On Behalf Of Uwe Ligges Sent: Tuesday, March 15, 2011 2:23 PM To: xiagao1982 Cc: r-help Subject: Re: [R] Does R have a const object? On 15.03.2011 15:53, xiagao1982 wrote: Hi, all, Does R have a const object concept like which is in C++ language? I want to set