Displaying 3 results from an estimated 3 matches for "resnew1".
Did you mean:
resnew
2013 Feb 17
6
histogram
HI Elisa,
You could use ?cut()
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2013 Feb 27
2
matrix multiplication
Hi,
Try this:
#mat1 is the data
res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2012 Dec 25
5
aggregate / collapse big data frame efficiently
Hi,
I need to aggregate rows of a data.frame by computing the mean for rows with the same factor-level on one factor-variable;
here is the sample code:
x <- data.frame(rep(letters,2), rnorm(52), rnorm(52), rnorm(52))
aggregate(x, list(x[,1]), mean)
Now my problem is, that the actual data-set is much bigger (120 rows and approximately 100.000 columns) ? and it takes very very long