If I understand properly, you want '-' to be
a generic function, which it currently isn't.
There may be a way to fake that (I can't think
of any).
But I'm wondering if you should rethink what
you want. The only reason that I can think of
that you would want to change '-' is because
of some
Wacek Kusnierczyk wrote:
Duncan Murdoch wrote:
You can use parent.frame() as the pos or envir argument to assign(),
and then the assignment happens in the caller's frame. And assign()
is also another way out if you overwrite - with something that
doesn't work; just call it to reassign
Duncan Murdoch wrote:
Wacek Kusnierczyk wrote:
Duncan Murdoch wrote:
You can use parent.frame() as the pos or envir argument to assign(),
and then the assignment happens in the caller's frame. And assign()
is also another way out if you overwrite - with something that
doesn't work; just
On Fri, Jan 23, 2009 at 5:15 AM, Patrick Burns pbu...@pburns.seanet.com wrote:
If I understand properly, you want '-' to be
a generic function, which it currently isn't.
There may be a way to fake that (I can't think
of any).
But I'm wondering if you should rethink what
you want. The only
On Fri, Jan 23, 2009 at 9:40 AM, Wacek Kusnierczyk
waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
you might want to specify what 'completely unrecoverable' means, and
what approaches are allowed.
for the former, i guess that:
- 'incompletely recoverable' means that there is at least one
On 1/23/2009 1:47 PM, Yi Zhang wrote:
On Fri, Jan 23, 2009 at 5:15 AM, Patrick Burns pbu...@pburns.seanet.com wrote:
If I understand properly, you want '-' to be
a generic function, which it currently isn't.
There may be a way to fake that (I can't think
of any).
But I'm wondering if you
On Fri, Jan 23, 2009 at 2:50 PM, Duncan Murdoch murd...@stats.uwo.ca wrote:
External pointers are the standard way to do that. You don't need to worry
about reference counting, R's garbage collector will call a finalizer when
it doesn't need the object any more.
I think the usual example of
Hi,
I want to create an alias for the - function and then later
overwrite it. Any idea how I can get the - function object? I know
for other functions it's easy, something like f - seq will do; how
really no clue for this one. Thanks!
__
Is there many functions:
See:
grep(-, ls(package:base), value = TRUE)
For 'substring-':
type `substring-` in R
On Thu, Jan 22, 2009 at 5:41 PM, Yi Zhang yizhan...@gmail.com wrote:
Hi,
I want to create an alias for the - function and then later
overwrite it. Any idea how I can get the -
On 1/22/2009 2:41 PM, Yi Zhang wrote:
Hi,
I want to create an alias for the - function and then later
overwrite it. Any idea how I can get the - function object? I know
for other functions it's easy, something like f - seq will do; how
really no clue for this one. Thanks!
get(-) will give it
On Thu, Jan 22, 2009 at 3:06 PM, Duncan Murdoch murd...@stats.uwo.ca wrote:
get(-) will give it to you, and
`-` - function(x, y) cat(x=, x, y=, y, \n)
will change it -- and will probably be the last effective thing you do in
that session, unless you're really careful:
x - 1
x
[1] 1
`-`
Duncan Murdoch wrote:
On 1/22/2009 2:41 PM, Yi Zhang wrote:
Hi,
I want to create an alias for the - function and then later
overwrite it. Any idea how I can get the - function object? I know
for other functions it's easy, something like f - seq will do; how
really no clue for this one.
On Thu, Jan 22, 2009 at 4:17 PM, Wacek Kusnierczyk
waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
Duncan Murdoch wrote:
On 1/22/2009 2:41 PM, Yi Zhang wrote:
Hi,
I want to create an alias for the - function and then later
overwrite it. Any idea how I can get the - function object? I know
for
Yi Zhang wrote:
# now what?? %#*
now you are really motivated to use '=' instead of '-':
x = 3
x
# 3
vQ
Thanks. That certainly is an option. But I want to preserve `-`'s
functionality because I'm writing a package and I don't want to limit
the package user's freedom
i was sort-of joking, though it's a real option if you want it.
but seriously, there's no reason for the %#* lamenting:
x - 1
'-' = function(x,y) 0
x - 2
# 0
.Primitive('-')(x,2)
x
# 2
base::'-'(x, 3)
x
# 3
base::'-'('-', base::'-')
x - 4
x
# 4
vQ
I'm still not sure if
On 22/01/2009 4:50 PM, Yi Zhang wrote:
i was sort-of joking, though it's a real option if you want it.
but seriously, there's no reason for the %#* lamenting:
x - 1
'-' = function(x,y) 0
x - 2
# 0
.Primitive('-')(x,2)
x
# 2
base::'-'(x, 3)
x
# 3
base::'-'('-', base::'-')
x - 4
x
# 4
vQ
Duncan Murdoch wrote:
You can use parent.frame() as the pos or envir argument to assign(),
and then the assignment happens in the caller's frame. And assign()
is also another way out if you overwrite - with something that
doesn't work; just call it to reassign base::`-` to it. Or just
17 matches
Mail list logo