Diferenças

Aqui você vê as diferenças entre duas revisões dessa página.

Link para esta página de comparações

Ambos lados da revisão anteriorRevisão anterior
Próxima revisão
Revisão anterior
ridiculas [2011/11/30 15:39] – [section 2] walmesridiculas [2012/10/25 15:45] (atual) – [section 8] walmes
Linha 262: Linha 262:
 #       http://www.youtube.com/watch?v=E4uR5I1uLFM #       http://www.youtube.com/watch?v=E4uR5I1uLFM
  
 +#------------------------------------------------------------------------------------------
 +
 +mergeAll <- function(..., by="date", all=TRUE){
 +  dotArgs <- list(...)
 +  Reduce(
 +         function(x, y){
 +           merge(x, y, by = by, all = all, suffixes=paste(".", names(dotArgs), sep = ""))
 +         },
 +         dotArgs)
 +}
 +
 +mergeAll(a = a1, b = a2, c = a3, by="id")
 +
 +str(.Last.value)
 +
 +You also might be able to set it up to capture names without you having to put "a = a" etc. using substitute.
 +
 +# http://r.789695.n4.nabble.com/merge-multiple-data-frames-td4331089.html
 +# ver reshape::merge_all()
 #------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------
 </code> </code>
Linha 405: Linha 424:
 da <- read.table(textConnection(lines), header=TRUE) da <- read.table(textConnection(lines), header=TRUE)
 str(da) str(da)
 +
 +#------------------------------------------------------------------------------------------
 +# para enviar para outra pessoa pode-se enviar o resultado do comando dput(), assim
 +
 +dput(da)
 +
 +# cole na mensagem o resulado que aparece no console ao executar essa linha
 +# assim a pessoa pode ler fazendo assim
 +
 +da <- 
 +structure(list(meses = structure(c(5L, 4L, 9L, 1L, 8L, 7L, 6L, 
 +2L, 12L, 11L, 10L, 3L), .Label = c("Abr", "Ago", "Dez", "Fev", 
 +"Jan", "Jul", "Jun", "Mai", "Mar", "Nov", "Out", "Set"), class = "factor"), 
 +    temp = c(26.49, 26.65, 27.19, 26.28, 26.62, 26.13, 25.83, 
 +    27.05, 27.6, 27.44, 26.56, 25.87), umidade = c(86.58, 88.49, 
 +    86.16, 89.75, 89.22, 87.83, 86.57, 83.14, 83.02, 85.16, 88.18, 
 +    90.63), rad = c(795.88, 710.24, 772.99, 574.88, 614.02, 680.08, 
 +    675.97, 756.44, 925.57, 927.71, 788.87, 703.94), chuva = c(0.36, 
 +    0.34, 0.21, 0.67, 0.31, 0.26, 0.15, 0.07, 0.14, 0.17, 0.19, 
 +    0.33)), .Names = c("meses", "temp", "umidade", "rad", "chuva"
 +), class = "data.frame", row.names = c(NA, -12L))
  
 #------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------
Linha 724: Linha 764:
 ---- ----
  
-==== Desdobramento de interação usando a multcomp::ghlt() ====+==== Desdobramento de interação usando a multcomp::glht() ====
  
 Temporariamente sem descrição.\\ Temporariamente sem descrição.\\

QR Code
QR Code ridiculas (generated for current page)