Skip to content
Prev 15057 / 63421 Next

Incorrect behavior for ordering timepoints in "reshape" (PR#7669)

davclark@nyu.edu writes:
Hmm, this looks messed up even without the negatives. The guess()
function inside reshape always sorts before converting to numeric, so
you get the 1 10 11 2 3 4 5 6 7 8 9 effect, but what is worse: the
sorting decouples the values from the variable names, as demonstrated
by modifying your example slightly
id time    vals
S1.-1 S1   -1 from -1
S1.-2 S1   -2 from -2

I'm not at all sure I understand what was supposed to happen here,
perhaps the sort in

    varying <- unique(nn[, 1])
    times <- sort(unique(nn[, 2]))

is a thinko? Over to Thomas, I think.