Re: [R] Increment certain values in a vector

2015-10-01 Thread Thomas Chesney
y > Sent: Thursday, October 01, 2015 12:04 PM > To: r-help@r-project.org > Subject: [R] Increment certain values in a vector > > How can I manipulate values of only certain entries in a vector, based > on what the existing values are? > > So for instance if I want to add

Re: [R] Increment certain values in a vector

2015-10-01 Thread PIKAL Petr
Hi Sarah > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sarah > Goslee > Sent: Thursday, October 01, 2015 1:01 PM > To: Thomas Chesney > Cc: r-help@r-project.org > Subject: Re: [R] Increment certain values in a vector &g

Re: [R] Increment certain values in a vector

2015-10-01 Thread Sarah Goslee
Hi, On Thursday, October 1, 2015, Thomas Chesney < thomas.ches...@nottingham.ac.uk> wrote: > How can I manipulate values of only certain entries in a vector, based on > what the existing values are? > > So for instance if I want to add one to each of the following values, or > multiply them by a

Re: [R] Increment certain values in a vector

2015-10-01 Thread PIKAL Petr
. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas > Chesney > Sent: Thursday, October 01, 2015 12:04 PM > To: r-help@r-project.org > Subject: [R] Increment certain values in a vector > > How can I manipula

[R] Increment certain values in a vector

2015-10-01 Thread Thomas Chesney
How can I manipulate values of only certain entries in a vector, based on what the existing values are? So for instance if I want to add one to each of the following values, or multiply them by a specific factor: agents[which(agent$membership == 1)] how would I do this please? If there was ju