On Fri, 6 Aug 2004, Doran, Harold wrote:
> Hi all:
>
>
>
> I solved the previous stated problem in something of a brute force way
> (but it works). I seem to now be running into one little hiccup using
> reshape. Here is a quick snip of the data in long format:
>
<snip>
>
> Now, I want to reshape this into the wide format. However, when I do I
> get NAs in the stability columns. Here is what I have done and the
> result.
>
> wide<- reshape(tennshort, idvar = c("schid","grade"), timevar = "year",
> v.names="stability", direction="wide")
>
reshape() doesn't support multiple idvars (it isn't documented to). You
have to do something like
tennshort$ID<-with(tennshort, interaction(schid,grade))
wide<- reshape(tennshort, idvar = "ID", timevar = "year",
v.names="stability", direction="wide")
This might be a useful extra feature in reshape, as might the ability to
specify multiple time variables (eg year, season)
-thomas
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html