[R] combination which limited - thanks again

Muhammad Subianto subianto at gmail.com
Mon Jun 13 18:13:36 CEST 2005


Dear all,
Again, I would like to thank Gabor Grothendieck for your help.
I can improve which you suggest with the others combination.
And thank you for your time.
Sincerely,
Muhammad Subianto

On this day 6/13/2005 2:38 PM, Gabor Grothendieck wrote:
> 
> The pattern seems to be that each row contains at most one column
> that is not at level 1.  That is the entry at row i and column col[i] has
> level lev[i] and all other entries are at level 1.
> 
> 	col <- c(1,1,1,1,2,3,3,4)
> 	lev <- c(1:4,2,2,3,2)
> 	mat <- matrix(1, length(col), 4)
> 	mat[cbind(seq(col),col)] <- lev
> 	data.frame(interface = factor(mat[,1], lab = interface),
> 		screen = factor(mat[,2], lab = screen),
> 		computer = factor(mat[,3], lab = computer),
> 		available = factor(mat[,4], lab = available))
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list