Stavros Macrakis wrote:
> On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck
> <ggrothendi...@gmail.com> wrote:
>   
>> See ?get and try:
>>     
>
> Interesting.  I hadn't paid attention to the 'mode' argument before.
>
> Where would it be advisable to use anything but mode='any' or mode='function'?
>
>   

don't know if it really is advisable, but you can imagine a scenario
where you have different-moded like-named variables within nested
scopes, e.g.:

x = TRUE
local({
    x = 0;
    local({
       x = 'foo';
       list(get('x'), get('x', mode='numeric'), get('x',
mode='logical')) }) })
# list('foo', 0, TRUE)

basically, you want, within a scope, the value of a variable named 'x'
from in the closest environment in which it has the given type of value.

vQ

______________________________________________
R-help@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.

Reply via email to