Re: [R] Create rows for columns in dataframe

2013-08-14 Thread Dark
Hi A.K, Thanks for your great help. I'm now running your first suggestion on a 600.000 row sample after verifying it works on a smaller sample. It's now been running for 40 minutes. Which method do you think will be faster? Regards Derk -- View this message in context:

Re: [R] Create rows for columns in dataframe

2013-08-14 Thread arun
(data.table).  Should be faster.. A.K. - Original Message - From: Dark i...@software-solutions.nl To: r-help@r-project.org Cc: Sent: Wednesday, August 14, 2013 5:41 AM Subject: Re: [R] Create rows for columns in dataframe Hi A.K, Thanks for your great help. I'm now running your

Re: [R] Create rows for columns in dataframe

2013-08-14 Thread arun
and after that combining them, any ideas on that? Regards Dirk - Original Message - From: arun smartpink...@yahoo.com To: R help r-help@r-project.org Cc: Sent: Wednesday, August 14, 2013 10:39 AM Subject: Re: [R] Create rows for columns in dataframe Hi, I tried the second method

Re: [R] Create rows for columns in dataframe

2013-08-14 Thread Dark
Hi Arun, The second method is indeed working much faster. It worked fast for my 600.000 row record. Still I have 2 bigger files where processing becomes an issue even though I have lots of memory (32 gig) for the second statement: res2-reshape(dat2,idvar=newCol,varying=list(2:26),direction=long)

[R] Create rows for columns in dataframe

2013-08-13 Thread Dark
Hi experts, I have a dataframe with 100k+ records. it has a key/id column and 25 code columns. I would like to restructure it having a row for each code column. I have a structure like this (used dput): structure(list(DSYSRTKY = structure(c(1L, 2L, 3L, 3L, 4L, 4L), .Names = c(1, 2, 3, 4, 5, 6),

Re: [R] Create rows for columns in dataframe

2013-08-13 Thread arun
-help@r-project.org Cc: Sent: Tuesday, August 13, 2013 5:46 AM Subject: [R] Create rows for columns in dataframe Hi experts, I have a dataframe with 100k+ records. it has a key/id column and 25 code columns. I would like to restructure it having a row for each code column. I have a structure like

Re: [R] Create rows for columns in dataframe

2013-08-13 Thread Dark
Hi, My desired output for my sample!! using dput(): structure(list(ID = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48), DSYSRTKY = c(10005, 10005,

Re: [R] Create rows for columns in dataframe

2013-08-13 Thread arun
Message - From: Dark i...@software-solutions.nl To: r-help@r-project.org Cc: Sent: Tuesday, August 13, 2013 12:16 PM Subject: Re: [R] Create rows for columns in dataframe Hi, My desired output for my sample!! using dput(): structure(list(ID = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

Re: [R] Create rows for columns in dataframe

2013-08-13 Thread arun
. - Original Message - From: arun smartpink...@yahoo.com To: R help r-help@r-project.org Cc: Sent: Tuesday, August 13, 2013 2:45 PM Subject: Re: [R] Create rows for columns in dataframe According to your first post, NewDataFrame - data.frame(ID=integer(), DSYSRTKY=integer(), CODE=character