Re: [R] How to re-combine values based on an index?

2012-12-02 Thread signal
-combine values based on an index? I am able to split my df into two like so: dataset - trainset index - 1:nrow(dataset) testindex - sample(index, trunc(length(index)*30/100)) trainset - dataset[-testindex,] testset - dataset[testindex,-1] So I have the index information

[R] How to re-combine values based on an index?

2012-12-01 Thread Brian Feeny
I am able to split my df into two like so: dataset - trainset index - 1:nrow(dataset) testindex - sample(index, trunc(length(index)*30/100)) trainset - dataset[-testindex,] testset - dataset[testindex,-1] So I have the index information, how could I re-combine the data using that back into a

Re: [R] How to re-combine values based on an index?

2012-12-01 Thread William Dunlap
-project.org Subject: [R] How to re-combine values based on an index? I am able to split my df into two like so: dataset - trainset index - 1:nrow(dataset) testindex - sample(index, trunc(length(index)*30/100)) trainset - dataset[-testindex,] testset - dataset[testindex,-1] So I have the index

Re: [R] How to re-combine values based on an index?

2012-12-01 Thread Brian Feeny
Of Brian Feeny Sent: Saturday, December 01, 2012 8:04 PM To: r-help@r-project.org Subject: [R] How to re-combine values based on an index? I am able to split my df into two like so: dataset - trainset index - 1:nrow(dataset) testindex - sample(index, trunc(length(index)*30/100)) trainset

Re: [R] How to re-combine values based on an index?

2012-12-01 Thread arun
 head(newdataset) #  ID  col2 #1  1 0.2002145 #2  2 0.6852186 #3  3 0.9168758 #4  4 0.2843995 #5  5 0.1046501 #6  6 0.7010575 A.K. - Original Message - From: Brian Feeny bfe...@mac.com To: r-help@r-project.org Cc: Sent: Saturday, December 1, 2012 11:04 PM Subject: [R] How to re-combine

Re: [R] How to re-combine values based on an index?

2012-12-01 Thread Berend Hasselman
-project.org Subject: [R] How to re-combine values based on an index? I am able to split my df into two like so: dataset - trainset index - 1:nrow(dataset) testindex - sample(index, trunc(length(index)*30/100)) trainset - dataset[-testindex,] testset - dataset[testindex,-1] So I have