Hi Sayan,
This is exactly what I was looking for - it worked perfectly.
Many thanks!!
Also, thanks to everyone else for their suggestions.
Pele
--
View this message in context:
http://r.789695.n4.nabble.com/For-loop-with-ifelse-help-tp2550547p2552388.html
Sent from the R help mailing list ar
Hi Pele,
I think this should work
file1$state.sum <- rowSums(file2[file1$state,6:10],0)
On Thu, Sep 23, 2010 at 7:46 PM, Steve Lianoglou <
mailinglist.honey...@gmail.com> wrote:
> Hi Pele,
>
> On Wed, Sep 22, 2010 at 12:40 PM, Pele wrote:
> >
> > Hi David - thanks for your suggestion, but I a
Hi Pele,
On Wed, Sep 22, 2010 at 12:40 PM, Pele wrote:
>
> Hi David - thanks for your suggestion, but I am trying to avoid doing any
> merging and sorting for this step because the real file I will be working
> with has about 20 million records. If I can get this loop or something
> similar to
Hi David - thanks for your suggestion, but I am trying to avoid doing any
merging and sorting for this step because the real file I will be working
with has about 20 million records. If I can get this loop or something
similar to work will be good enough.
thanks again..
--
View this message
On Sep 22, 2010, at 11:42 AM, Pele wrote:
Hello R users,
I have 2 files (file1 and f2) and I am trying to sum columns 6:10 of a
specific row in f2 and append it in
file 1 if the "state" variable in file 1 equals the rowname in f2.
Below is
an example of the code I wrote
using a for loop,
5 matches
Mail list logo