[R-br] Criação de data.frame com valores médios de variaveis

Gilenio Borges Fernandes gilenio em ufba.br
Domingo Setembro 14 15:09:06 BRT 2014


Prezados(as)


Tenho um banco de dados com as seguintes variáveis (colunas):

Tipo Trat Tempo Triplicata acidezKOH e acidezOLEIC

Segue o CMR com a estrutura do meu banco de dados:
d1=structure(list(Tipo = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("TI1", "TI2",
"TI3"), class = "factor"), Trat = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("TR1",
"TR2", "TR3"), class = "factor"), Tempo = c(0L, 0L, 0L, 3L, 3L,
3L, 6L, 6L, 6L, 0L, 0L, 0L, 3L, 3L, 3L, 6L, 6L, 6L, 0L, 0L, 0L,
3L, 3L, 3L, 6L, 6L, 6L, 0L, 0L, 0L, 3L, 3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2.87, 2.92, 2.89, 2.87, 1.59, 1.52, 1.62, 2.68, 2.68,
2.66, 2.85, 2.89, 2.86, 0.11, 0.11, 0.11, 0.15, 0.15, 0.15, 0.17,
0.16, 0.16, 0.13, 0.14, 0.13, 0.17, 0.18, 0.17, 0.22, 0.2, 0.21,
0.13, 0.13, 0.14, 0.15, 0.17, 0.15, 0.17, 0.16, 0.16, 0.04, 0.04,
0.04, 0.17, 0.17, 0.17, 0.19, 0.19, 0.17, 0.07, 0.07, 0.07, 0.15,
0.15, 0.15, 0.17, 0.16, 0.16, 0.29, 0.29, 0.29, 0.17, 0.17, 0.17,
0.4, 0.39, 0.4)), .Names = c("Tipo", "Trat", "Tempo", "Triplicata",
"acidezKOH", "acidezOLEIC"), class = "data.frame", row.names = c(NA,
-81L))


Preciso criar um banco de dados (data.frame) com as colunas: Tipo Trat
Tempo e mais as colunas acidezKOH e acidezOLEIC com a média das três
Triplicatas. Tentei fazer com a função tapply, mas, não resolve porque não
cria uma estrutura de data.frame. Gostaria de ter auxilio da lista para
este problema.

Desde já agradeço.

Cordialmente,
-- 
Gilenio Borges Fernandes
Professor Associado IV (Aposentado)
Universidade Federal da Bahia
Instituto de Matemática
Departamento de Estatística
Av. Adhemar de Barros, s/n – Ondina.
40.170-110 - Salvador - BA, Brasil
Tel.: (071)3283-6340/6341/6337  Fax:  (071)3283-6336
URL: http://lattes.cnpq.br/6764860618464860
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20140914/9a79fcbf/attachment.html>


Mais detalhes sobre a lista de discussão R-br