
18 Ago
2011
18 Ago
'11
12:50
Pergunta1) sort(apply(expand.grid(0:5, 0:2, 1:2, 0:2), 1, paste, collapse='')) Pergunta2) do.call(rbind, tapply(x, y, function(z) c(media=mean(z), desvp=sd(z), fper=fper(z)))) ou aggregate(x, by=list(Grupo=y), function(z) c(media=mean(z), desvp=sd(z), fper=fper(z))) ou, se vc quiser "embelezar": g = function(z) c(media=mean(z), desvp=sd(z), fper=fper(z)) do.call(rbind, tapply(x, y, g)) aggregate(x, by=list(Grupo=y), g) b