The unstack function is a bit clumsy for this problem:
library(MASS)
cbind(Treatment = unstack(Rabbit, Treatment ~ Animal)[,1],
Dose = unstack(Rabbit, Dose ~ Animal)[,1],
unstack(Rabbit, BPchange ~ Animal))
A much better choice would be to use the reshape package:
require(reshape)
rec
Hi Everyone,
I am trying to understand the unstack() function but after struggling for
two days, I have given up. More specifically, I am trying the exercises at
the end of Chapter 1 of Data Analysis and Graphics Using R by Maindonald
and Braun, 2nd ed. Exercise 18 (p. 41) asks to unstack the Rab
2 matches
Mail list logo