Re: [R] selecting a subset of a matrix based on a value occurring in 5 records

2008-12-24 Thread Veslot Jacques
> mat[,colSums(mat!=0)>=5] Jacques VESLOT CEMAGREF - UR Hydrobiologie Route de Cézanne - CS 40061 13182 AIX-EN-PROVENCE Cedex 5, France Tél. + 0033 04 42 66 99 76 fax+ 0033 04 42 66 99 34 email jacques.ves...@cemagref.fr >-Message d'origine- >De : r-help-boun...@r-

Re: [R] Using 'cat' on data frame

2008-12-23 Thread Veslot Jacques
print(as.matrix(raw.count),quote=F) cat(as.character(raw.count$Var1)) Jacques VESLOT CEMAGREF - UR Hydrobiologie Route de Cézanne - CS 40061 13182 AIX-EN-PROVENCE Cedex 5, France Tél. + 0033 04 42 66 99 76 fax+ 0033 04 42 66 99 34 email jacques.ves...@cemagref.fr >-Me

Re: [R] sliding window over a large vector

2008-12-16 Thread Veslot Jacques
RUE Jacques VESLOT CEMAGREF - UR Hydrobiologie Route de Cézanne - CS 40061 13182 AIX-EN-PROVENCE Cedex 5, France Tél. + 0033 04 42 66 99 76 fax+ 0033 04 42 66 99 34 email jacques.ves...@cemagref.fr >-Message d'origine- >De : markle...@verizon.net [mailto

Re: [R] sliding window over a large vector

2008-12-16 Thread Veslot Jacques
> sl <- function(x,z) c(0,cumsum(diff(x)[1:(length(x)-z-1)])) + > rep(sum(x[1:z]),length(x)-z) > x <- rbinom(10, 1, 0.5) > system.time(xx1 <- slide(x,12)) utilisateur système écoulé 36.860.45 37.32 > system.time(xx2 <- sl(x,12)) utilisateur système écoul

Re: [R] factor manipulation: edgelist to a matrix?

2007-12-19 Thread Veslot Jacques
do.call(rbind,lapply(split(as.character(z[,2]),z[,1]), function(x) c(x, rep(NA, max(table(z[,1]))-length(x) Jacques VESLOT CEMAGREF - UR Hydrobiologie Route de Cézanne - CS 40061 13182 AIX-EN-PROVENCE Cedex 5, France Tél + 0033 04 42 66 99 76 email [EMAIL PROTECTED] >