[Rd] assign("FALSE", TRUE)

Rolf Turner r.turner at auckland.ac.nz
Mon Nov 17 20:49:21 CET 2008


It was recently pointed out by Wacek Kusnierczyk that although one is
prevented from doing

	FALSE <- TRUE

one *can* do

	assign("FALSE",TRUE)

and have an object named ``FALSE'' with value TRUE in one's workspace.

This apparently has no deleterious effects; e.g. doing

	sample(1:7,replace=FALSE)

gives a random permutation of 1:7 as expected and desired.  I.e. the
local object named ``FALSE'' is not used.

Still, this seems counterintuitive and a bit confusing.  Is it the  
intended
state of affairs?  I would have thought that

	FALSE <- <whatever>

and

	assign("FALSE",<whatever>)

would be completely equivalent.

This is clearly not a very important issue, but it might bear some  
thinking about.

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-devel mailing list