Re: [R] Replace the value with 1 and 0

2015-02-26 Thread Göran Broström
On 2015-02-26 00:33, JS Huang wrote: Hi, Here is an implementation. More data are added. An extra column hasRain is added instead of replacing column Amount. rain Year Month Day Amount 1 1950 1 10.0 2 1950 1 2 35.5 3 1950 1 3 17.8 4 1950 1 4 24

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread JS Huang
Hi, Here is an implementation. More data are added. An extra column hasRain is added instead of replacing column Amount. > rain Year Month Day Amount 1 1950 1 10.0 2 1950 1 2 35.5 3 1950 1 3 17.8 4 1950 1 4 24.5 5 1950 1 5 12.3 6 1950 1

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread Clint Bowman
me tidying up. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of smart hendsome Sent: Thursday, 26 February 2015 11:54 a.m. To: r-help@r-project.org Subject: [R] Replace the value with 1 and 0 Hi everyone, I have this kind of rainfall da

Re: [R] Replace the value with 1 and 0

2015-02-25 Thread Peter Alspach
;month')], sum) will give your final table, but it will need some tidying up. HTH Peter Alspach -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of smart hendsome Sent: Thursday, 26 February 2015 11:54 a.m. To: r-help@r-project.org Subject: [R] Re

[R] Replace the value with 1 and 0

2015-02-25 Thread smart hendsome
Hi everyone, I have this kind of rainfall dataset:    Year Month Day Amount 1  1950 1   1    0.0 2  1950 1   2   35.5 3  1950 1   3   17.8 4  1950 1   4   24.5 5  1950 1   5   12.3 6  1950 1   6   11.5 7  1950 1   7    5.7 8  1950 1   8   13.2 9  1950 1   9   11.