Re: [R] dataset index

2009-12-03 Thread Lisa
Thank you for your help. Your script works very well. Lisa jholtman wrote: > > Does this do what you want: > >> x <- matrix(c( > + 0, 0, 0, > + 0, 0, 0, > + 0, 1, 0, > + 0, 1, 0, > + 0, 1, 0, > + 1, 2, 1, > + 1, 2, 1, > + 1, 3, 1, > + 1, 3, 1, > + 1, 3, 1), > + ncol = 3, byrow = T, > + dimn

Re: [R] dataset index

2009-12-03 Thread Charles C. Berry
On Thu, 3 Dec 2009, Lisa wrote: Hello, All, I have a dataset that looks like this: x <- matrix(c( 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1), ncol = 5, byrow = T, dimnames = list(1:10, c("gender", "race", "disease"))) I want to write a function

Re: [R] dataset index

2009-12-03 Thread jim holtman
Does this do what you want: > x <- matrix(c( + 0, 0, 0, + 0, 0, 0, + 0, 1, 0, + 0, 1, 0, + 0, 1, 0, + 1, 2, 1, + 1, 2, 1, + 1, 3, 1, + 1, 3, 1, + 1, 3, 1), + ncol = 3, byrow = T, + dimnames = list(1:10, c("gender", "race", "disease"))) > key <- apply(x, 1, paste, collapse=":") > m.flags <- lapply(

[R] dataset index

2009-12-03 Thread Lisa
Hello, All, I have a dataset that looks like this: x <- matrix(c( 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1), ncol = 5, byrow = T, dimnames = list(1:10, c("gender", "race", "disease"))) I want to write a function to produce several matrices inc