hi, please help me out in the following case. seems like it stuck in some where(already 7 hrs passed). what I want is to combine 4 matrix in to one matrix of desired length.
final_matrix<-function(ob_feat,content_feat,link_feat,link_feat_transformed){ complete_feat<-matrix(rep(-1),nrow=11402,ncol=278) for(i in 1:8944) {q<-c(0) for(j in 1:11402) { if(as.matrix(content_feat[i,2])==as.matrix(ob_feat[j,2])) {complete_feat[i,1]=as.matrix(ob_feat[j,2]) complete_feat[i,2:97]=as.matrix(content_feat[i,3:98]) complete_feat[i,98:99]=as.matrix(ob_feat[j,3:4]) complete_feat[i,100:140]=as.matrix(link_feat[j,3:43]) complete_feat[i,141:278]=as.matrix(link_feat_transformed[j,3:140]) q<-1} if(q==1) break; } } for (i in 8945:11402){ complete_feat[i,1]=as.matrix(ob_feat[i,2]) complete_feat[i,98:99]=as.matrix(ob_feat[i,3:4]) complete_feat[i,100:140]=as.matrix(link_feat[i,3:43]) complete_feat[i,141:278]=as.matrix(link_feat_transformed[i,3:140]) } list(complete_feat=complete_feat) } kind regards, mahmudul haque __________________________________________________ [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.