Obrigadão Henrique,
 
It is doing well with big datasets,
 
See you,
 
Diogo André Alagador
Portugal

________________________________

From: Henrique Dallazuanna [mailto:wwwhsd@gmail.com]
Sent: Mon 22-10-2007 22:48
To: Diogo Alagador
Cc: r-help@r-project.org
Subject: Re: [R] median value dataframe coming from multiple dataframes


Hi, 

What is your data?

I've tested with :
df1 <- data.frame(x=rnorm(10), y=rnrom(10))


On 22/10/2007, Diogo Alagador < alagador@oniduo.pt <mailto:alagador@oniduo.pt> > wrote: 

	Sorry Henrique
	 
	But I'm affraid now the result was
	 
	 
	    x  y
	1  1  2
	2  1  2
	3  1  2
	4  1  2
	5  1  2
	6  1  2
	 
	 
	I think we are very close to the solution. But it isn't this one!!!
	 
	Where should I look for?
	 
	 
	Sorry for the inconvenience,
	 
	Diogo André Alagador
	Portugal
	 
	 
	 

	from: Henrique Dallazuanna [mailto: wwwhsd@gmail.com <mailto:wwwhsd@gmail.com> ] 
	Sent: segunda-feira, 22 de Outubro de 2007 21:03
	for: Diogo Alagador
	Cc: r-help@r-project.org
	 Re: [R] median value dataframe coming from multiple dataframes

	 

	Hi Diogo, 
	
	teste <- function(x){
	    if(!is.list(x))stop("A list is needed")
	        df_out <- matrix(0, ncol=ncol(x[[1]]), nrow=nrow(x[[1]]))
	            for(i in 1:ncol(x[[1]])){ 
	            df_out[,i] <- apply( do.call("rbind", lapply(x, "[[", i)), 2, median)    
	        }
	    return(df_out)
	}
	
	x <- list(df1, df2, df3, df4)
	
	teste(x)
	
	-- 
	Henrique Dallazuanna
	Curitiba-Paraná-Brasil 
	25° 25' 40" S 49° 16' 22" O 

	 
	 




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O 

	[[alternative HTML version deleted]]

