Due to over-sized matrix from combn(letters,13), I tried to only output one selection which is satisfied with the criteria in if clause. This is how my code looks like and the ERROR message shows: > li<-combn(letters,13,function(x)(if(apply(( (as.matrix(t(letters%in% x))) %*% > as.matrix(z) )**2,1,sum)==balance){x}else {x=NULL}))
Error in matrix(r, nrow = len.r, ncol = count) : attempt to set an attribute on NULL Can anybody know how to solve this problem? Thanks in advance! Snow [[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.