C. Joseph Lu
2000-Dec-22 06:20 UTC
[R] Do we have similar function to Minitab's INDICATOR?
Dear R-Friends, Do we have a similar R function to work like Minitab's INDICATOR? INDICATOR C2, C11-C15 C2 C11 C12 C13 C14 C15 2 1 0 0 0 0 2 1 0 0 0 0 5 ------> 0 0 0 1 0 3 0 1 0 0 0 6 0 0 0 0 1 5 0 0 0 1 0 * * * * * * where * is missing code in Minitab. Best regards, C. Joseph Lu Department of Statistics National Cheng-Kung University Tainan, Taiwan -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thomas Lumley
2000-Dec-22 17:18 UTC
[R] Do we have similar function to Minitab's INDICATOR?
On Fri, 22 Dec 2000, C. Joseph Lu wrote:> Dear R-Friends, > > Do we have a similar R function to work like Minitab's INDICATOR?You can do it with outer(C2,sort(unique(C2)),function(i,j) as.numeric(i=j)) and model.matrix also does something similar. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._