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]]


