Skip to content

newbie question about index

2 messages · Gabor Grothendieck

#
Try using outer:

outer(1:3, a, "==")+0
On 8/31/06, z s <flyhyena at yahoo.com.cn> wrote:
#
Here is an additional way:

model.matrix(~ factor(a) - 1)
On 9/1/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote: