.
Duncan Murdoch
-Original Message-
From: Duncan Murdoch [mailto:murd...@stats.uwo.ca]
Sent: Wednesday, April 29, 2009 5:10 PM
To: Steven McKinney
Cc: R-help@r-project.org
Subject: Re: [R] Corrupt data frame construction - bug?
On 29/04/2009 6:41 PM, Steven McKinney wrote:
Hi useRs
Duncan Murdoch wrote:
On 29/04/2009 6:41 PM, Steven McKinney wrote:
foo - matrix(1:12, nrow = 3)
bar - data.frame(foo)
bar$NewCol - foo[foo[, 1] == 4, 4]
bar
X1 X2 X3 X4 NewCol
1 1 4 7 10 NA
2 2 5 8 11 NA
3 3 6 9 12 NA
Warning message:
In format.data.frame(x, digits =
Duncan Murdoch wrote:
On 29/04/2009 9:21 PM, Steven McKinney wrote:
Thanks Duncan,
Comments and a proposed bug fix in-line below:
Thanks; sorry for the misinformation about the $ method.
maybe it's a good idea to change your strategy and avoid blaming users
for faults that lie on the
Hi useRs,
A recent coding infelicity along these lines
yielded a corrupt data frame.
foo - matrix(1:12, nrow = 3)
bar - data.frame(foo)
bar$NewCol - foo[foo[, 1] == 4, 4]
bar
lapply(bar, length)
foo - matrix(1:12, nrow = 3)
bar - data.frame(foo)
bar$NewCol - foo[foo[, 1] == 4, 4]
bar
On 29/04/2009 6:41 PM, Steven McKinney wrote:
Hi useRs,
A recent coding infelicity along these lines
yielded a corrupt data frame.
foo - matrix(1:12, nrow = 3)
bar - data.frame(foo)
bar$NewCol - foo[foo[, 1] == 4, 4]
bar
lapply(bar, length)
foo - matrix(1:12, nrow = 3)
bar -
Thanks Duncan,
Comments and a proposed bug fix in-line below:
-Original Message-
From: Duncan Murdoch [mailto:murd...@stats.uwo.ca]
Sent: Wednesday, April 29, 2009 5:10 PM
To: Steven McKinney
Cc: R-help@r-project.org
Subject: Re: [R] Corrupt data frame construction - bug
6 matches
Mail list logo