named: Tools to experiment with the NAMED setting of an R object

Description Usage Arguments Value Author(s) References Examples

View source: R/named.R

Description

THESE ARE INTENDED ONLY FOR EXPERIMENTATION. DON'T MESS WITH THEM IN REGULAR COMPUTATIONS.

These functions allow one to access the NAMED setting of an R object. Rather than using the R function to query the current value, one must call the C routine directly to avoid changing the value of NAMED during the call because the object becomes bound to the parameter name x. Setting the value works fine via R functions.

Usage

1
2
named(obj, val = -1)
named(obj) <- val

Arguments

obj

the R object whose NAMED value is to be queried or set.

val

the value to set the NAMED value to

Value

An integer. Setting the value returns the value of NAMED just before changing to the specified new value. This allows one to restore the value.

Author(s)

Duncan Temple Lang

References

R Internals Manual

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 .Call("R_named", 1:10)

 x = 1:10
 .Call("R_named", x)
 y = x
 .Call("R_named", x)

 rm(y)

 .Call("R_setNamed", x, 1L)
 .Call("R_named", x)

  # BAD - gives 2
  named(1:10)

omegahat/RTiming documentation built on May 24, 2019, 1:55 p.m.