Re: [R] reshape matrix entities to columns

2010-09-16 Thread Dennis Murphy
-- > *From:* David Winsemius > *To:* Natasha Asar > *Cc:* Dennis Murphy ; r-help@r-project.org > *Sent:* Tue, 14 September, 2010 2:24:19 > > *Subject:* Re: [R] reshape matrix entities to columns > > > On Sep 13, 2010, at 8:51 PM, Natasha Asar wrote: > >

Re: [R] reshape matrix entities to columns

2010-09-16 Thread Natasha Asar
2:24:19 Subject: Re: [R] reshape matrix entities to columns On Sep 13, 2010, at 8:51 PM, Natasha Asar wrote: I am trying this as you mentioned and getting an error which i cant fix >do you know where is the problem? > > >> df2[is.na(df2)] <- 0 >> df2 > X age

Re: [R] reshape matrix entities to columns

2010-09-13 Thread Natasha Asar
, 2010 23:16:47 Subject: Re: [R] reshape matrix entities to columns Thanks, David; I overlooked that part. Dennis On Sun, Sep 12, 2010 at 1:18 PM, David Winsemius wrote: > > On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote: > > Hi: >> >> Natasha said: >>

Re: [R] reshape matrix entities to columns

2010-09-13 Thread David Winsemius
-- David > > > Natatsha > > From: Dennis Murphy > To: David Winsemius > Cc: r-help@r-project.org > Sent: Sun, 12 September, 2010 23:16:47 > Subject: Re: [R] reshape matrix entities to columns > > Thanks, David; I overlooked that part. > > Dennis > > On

Re: [R] reshape matrix entities to columns

2010-09-13 Thread Natasha Asar
:18:26 Subject: Re: [R] reshape matrix entities to columns On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote: > Hi: > > Natasha said: > > I changed it so i hope it will look better now > the matrix is like this: > AgeNo. Age No. Age

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Dennis Murphy
Thanks, David; I overlooked that part. Dennis On Sun, Sep 12, 2010 at 1:18 PM, David Winsemius wrote: > > On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote: > > Hi: >> >> Natasha said: >> >> I changed it so i hope it will look better now >> the matrix is like this: >>Age

Re: [R] reshape matrix entities to columns

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote: Hi: Natasha said: I changed it so i hope it will look better now the matrix is like this: AgeNo. Age No. AgeNo. Center1 52 8 7 Center210 720 9 4

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Dennis Murphy
Hi: Natasha said: I changed it so i hope it will look better now the matrix is like this: AgeNo. Age No. AgeNo. Center1 52 8 7 Center210 720 9 4 10 column name = sequence of age-no. But what I w

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Natasha Asar
I changed it so i hope it will look better now the matrix is like this: AgeNo. Age No. AgeNo. Center1 52 8 7 Center210 720 9 4 10 column name = sequence of age-no. But what I want the data to loo

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Dennis Murphy
Hi: Here's a made up example using the reshape function: Input data: df <- structure(list(center = 1:3, age1 = c(6L, 7L, 5L), n1 = c(10L, 12L, 6L), age2 = c(8L, 8L, 8L), n2 = c(13L, 14L, NA), age3 = c(10L, 10L, 9L), n3 = c(9L, NA, 10L), age4 = c(12L, 11L, 11L), n4 = c(7L, 16L, 12L), age5 = c(14L,

Re: [R] reshape matrix entities to columns

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 10:45 AM, Natasha Asar wrote: Greeting R helpers J I am not familiar with R but I have to use it to analyze data set that I have (30,000 20,000) I want to change the structure of the dataset and I am wondering how that might be possible in R A main data looks like this

[R] reshape matrix entities to columns

2010-09-12 Thread Natasha Asar
Greeting R helpers J I am not familiar with R but I have to use it to analyze data set that I have (30,000 20,000) I want to change the structure of the dataset and I am wondering how that might be possible in R A main data looks like this: some entities are empty AgeNo. Age