From dwilhelm at lanl.gov  Tue Jul 17 00:06:06 2007
From: dwilhelm at lanl.gov (Daniel Wilhelm)
Date: Mon, 16 Jul 2007 16:06:06 -0600
Subject: [Rd] Field initialization order bug?
Message-ID: <p0624081dc2c19b42aa26@[128.165.72.98]>

I believe that I may have found a bug in R. The top code sample gives 
an error as shown. However, by simply switching which field is 
initialized first as in the bottom code sample, it works as expected.


This gives an error:


a <- NULL
a[["field1"]] <- 1
a[["field2"]] <- matrix(c(2,1), 1)

Error in a[["field2"]] <- matrix(c(2, 1), 1) :
	more elements supplied than there are to replace



Yet, this works as expected:

a <- NULL
a[["field2"]] <- matrix(c(2,1), 1)
a[["field1"]] <- 1



Daniel Wilhelm



[Rd] Field initialization order bug?
Daniel Wilhelm