Re: [Rd] unexpected result from reshape

2007-11-24 Thread Peter Dalgaard
Antonio, Fabio Di Narzo wrote: > Hi all. > I have unexpected reshape results on datasets with certain variable > names. Here a reproducible example: > > d <- matrix(seq_len(7*7), 1, 7*7) > vnames <- > c('acc','ppeGross','CF','ROA','DeltaSales','invTA','DeltaRevDeltaRec') > varying <- unlist(lapply

Re: [Rd] unexpected result from reshape

2007-11-24 Thread Antonio, Fabio Di Narzo
I got the problem: dataframe columns are re-ordered alfabetically, but variable names aren't reordered accordingly in the resulting dataframe. The problem disappears by specifying the 'varying' argument as a named list: d <- matrix(seq_len(7*7), 1, 7*7) vnames <- c('acc','ppeGross','CF','ROA','Del

[Rd] unexpected result from reshape

2007-11-24 Thread Antonio, Fabio Di Narzo
Hi all. I have unexpected reshape results on datasets with certain variable names. Here a reproducible example: d <- matrix(seq_len(7*7), 1, 7*7) vnames <- c('acc','ppeGross','CF','ROA','DeltaSales','invTA','DeltaRevDeltaRec') varying <- unlist(lapply(vnames, paste, 1:7, sep='.')) d <- data.frame(