Re: [R] Corrupt data frame construction - bug?

2009-04-30 Thread Duncan Murdoch
. 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

Re: [R] Corrupt data frame construction - bug?

2009-04-30 Thread Wacek Kusnierczyk
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 =

Re: [R] Corrupt data frame construction - bug?

2009-04-30 Thread Wacek Kusnierczyk
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

[R] Corrupt data frame construction - bug?

2009-04-29 Thread Steven McKinney
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

Re: [R] Corrupt data frame construction - bug?

2009-04-29 Thread Duncan Murdoch
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 -

Re: [R] Corrupt data frame construction - bug?

2009-04-29 Thread Steven McKinney
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