From weigand.stephen at gmail.com  Wed Apr  1 01:33:05 2009
From: weigand.stephen at gmail.com (Stephen Weigand)
Date: Tue, 31 Mar 2009 18:33:05 -0500
Subject: [Rd] 'sep' argument in reshape()
Message-ID: <bc47d3330903311633m6e90c73dn32b48d7e984276d4@mail.gmail.com>

I wonder if the 'sep' argument in reshape() is being ignored
unintentionally:

## From example(reshape)
 df <- data.frame(id=rep(1:4,rep(2,4)),
                  visit=I(rep(c("Before","After"),4)),
                  x=rnorm(4), y=runif(4))

reshape(df, timevar="visit", idvar="id", direction="wide", sep = "_")

  id x.Before y.Before x.After y.After
1  1    0.773    0.293  -0.021   0.658
3  2   -0.518    0.351  -0.623   0.946
5  3    0.773    0.293  -0.021   0.658
7  4   -0.518    0.351  -0.623   0.946

Is this more of the intended result when 'sep = "_"'?

  id x_Before y_Before x_After y_After
1  1    0.773    0.293  -0.021   0.658
3  2   -0.518    0.351  -0.623   0.946
5  3    0.773    0.293  -0.021   0.658
7  4   -0.518    0.351  -0.623   0.946

Thanks,

Stephen
-- 
Rochester, Minn. USA



[Rd] 'sep' argument in reshape()
Stephen Weigand