Displaying 4 results from an estimated 4 matches for "diftime".
Did you mean:
difftime
2015 Mar 19
2
Familia *pply
...s=replicate(1000,{
sel=sample(1:20,10)
pareja=sample(sel,100,replace = T)
ta=Sys.time()
recep=NULL
for(i in 1:100){
n=col[i]
m=pareja[i]
c=data[m,n]
recep=c(recep,c)
}
tb=Sys.time()
media=mean(recep)
tt=tb-ta
c(media,tt)
},simplify=T)
t2=Sys.time()
diftime=(t2-t1)[[1]]
sum(medias[2,])/diftime
Fernando Macedo
El 18/03/15 a las 21:06, Jorge I Velez escribió:
> Hola Fernando,
>
> No puedo ver las negritas, pero intuyo que lo que quieres es calcular
> la media por columnas? Si es asi, hay dos maneras:
>
> 1. Usa colMeans(x), dond...
2015 Mar 21
2
Familia *pply
...gt; pareja <- sample(sel,100,replace = T)
> ta <- Sys.time()
> *#cambio
> resnew <- mapply(myfun, pareja, col)
> #cambio *
> tb <- Sys.time()
> media <- mean(resnew)
> tt <- tb-ta
> c(media,tt)
> })
>
> t2 <- Sys.time()
>
> diftime=(t2-t1)[[1]]
> diftime
>
> sum(medias[2,])/diftime
>
> #-------------------------
>
>
>
> Saludos,
> Carlos Ortega
> www.qualiytexcellence.es <http://www.qualiytexcellence.es>
>
> El 19 de marzo de 2015, 1:14, Fernando Macedo <fermace en gmail.com
&g...
2015 Mar 19
3
Familia *pply
...eplace = T)
ta=Sys.time()
*recep=NULL**
** for(i in 1:100){**
** n=col[i]**
** m=pareja[i]**
** c=data[m,n]**
** recep=c(recep,c)**
** }**
* tb=Sys.time()
media=mean(recep)
tt=tb-ta
c(media,tt)
})
t2=Sys.time()
diftime=(t2-t1)[[1]]
sum(medias[2,])/diftime
la parte que está en negrita (si usé bien los Sys.time()) me representa
(hice varias pruebas) aprox un 60% del tiempo total empleado.
Mi pregunta es, para este ejemplo ¿cómo plantearían una solución usando
funciones *pply?
Y luego ver cuanto aumenta en...
2002 Oct 17
4
Posix Problem, difftime
...I used a for loop, which is very slow and it produces the following error. The last column is the difference in times between subsequent posit values. The fourth row shows a 2 hour gap between events. (This did not happen in any of the other days. )
tide posit diffh y365 diftime
7223 -1.25 1901-10-28 22:00:00 -2.7 301 1
7224 -2.75 1901-10-28 23:00:00 -1.5 301 1
7225 -2.25 1901-10-29 00:00:00 0.5 302 1
7226 -0.25 1901-10-29 01:00:00 2.0 302 2
7227 2.65 1901-10-29 02:00:00 2.9 302 1
Any help or suggestions are greatly appreciated...