[Rd] nested assignment (PR#2575)

larry@cognition.wustl.edu larry@cognition.wustl.edu
Sun Feb 23 23:54:02 2003


> A <- list(B=1, C=2, D=3)		# A list of 3 elements
> attach(A)				# Attach it to the search list

> assign("D", 4, pos="A")		# Assign a new value to 'D', inside 'A'


> ls()
  D					# Looks good ...

> D
  4					# Looks good ...
  
> A
  $B
  [1] 1

  $C
  [1] 1

  $D
  [1] 3					# Huh?


*Both* values of 'D' somehow live in 'A':

> detach("A")
> attach("A")
> D
  3					# Now the changed value is gone


I'd greatly appreciate if you'd let me know if I'm just doing something
silly; my email is larry@eye-hand.wustl.edu
But even if I *am* doing something silly, perhaps there's something in
the documentation that might be changed to prevent someone else from
making the same error.

Thanks!

larry
larry@eye-hand.wustl.edu



--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 1
 minor = 6.1
 year = 2002
 month = 11
 day = 01
 language = R

Search Path:
 .GlobalEnv, A, package:ctest, Autoloads, package:base