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
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
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(
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
4 matches
Mail list logo