Re: [R] need for help for solving operations in a vector

2015-12-30 Thread Bert Gunter
> Sent: Tuesday, December 29, 2015 9:12 PM > To: PIKAL Petr > Cc: r-help@r-project.org > Subject: RE: [R] need for help for solving operations in a vector > > > Hi Petr > I do thé calculation left as follows > > Irrig=qWC1 > Irrig [Irrig>HM]=-1 > Irrig[Irrig>0]

Re: [R] need for help for solving operations in a vector

2015-12-29 Thread PIKAL Petr
PIKAL Petr Cc: r-help@r-project.org Subject: RE: [R] need for help for solving operations in a vector Hi Petr I do thé calculation left as follows Irrig=qWC1 Irrig [Irrig>HM]=-1 Irrig[Irrig>0]=0 Irrig.tot=-Irrig*6.123 #6.123 is the hydraulic conductivity at saturation And I got the v

Re: [R] need for help for solving operations in a vector

2015-12-29 Thread Makram Belhaj Fraj
Hi Petr I do thé calculation left as follows Irrig=qWC1 Irrig [Irrig>HM]=-1 Irrig[Irrig>0]=0 Irrig.tot=-Irrig*6.123 #6.123 is the hydraulic conductivity at saturation And I got the vector needed Cheers Makram Le 28 déc. 2015 12:15, "PIKAL Petr" a écrit : > Hi > > On top of answers you have got h

Re: [R] need for help for solving operations in a vector

2015-12-29 Thread Makram Belhaj Fraj
t(tint, qWC1,col=(qWC1>HM)+1, pch=19) > > > > You can see which values are considered as belonging to the peak when you > are changing the threshold. > > > > However this simple approach works only if you have only one peak in your > data. > > > > Chee

Re: [R] need for help for solving operations in a vector

2015-12-29 Thread PIKAL Petr
om] Sent: Tuesday, December 29, 2015 12:33 PM To: PIKAL Petr Cc: r-help@r-project.org Subject: Re: [R] need for help for solving operations in a vector Hi Petr I runned the code you gave me as following, and I am adjusting for the threshold as suggested, sss<-smooth.spline(qWC1, tint, nknots=le

Re: [R] need for help for solving operations in a vector

2015-12-29 Thread Makram Belhaj Fraj
4536L, >> >> 5043L, 5310L, 5638L, 5792L, 5699L, 5374L, 4886L, 4473L, 4293L, >> >> 3757L, 3319L, 2934L, 2422L, 1998L, 1753L, 1397L, 1163L, 972L, >> >> 854L, 775L, 648L, 695L, 616L, 553L, 554L, 509L, 530L, 483L, 482L, >> >> 406L, 451L, 422L, 403L, 393L, 396

Re: [R] need for help for solving operations in a vector

2015-12-29 Thread Makram Belhaj Fraj
53L, 1397L, 1163L, 972L, > > 854L, 775L, 648L, 695L, 616L, 553L, 554L, 509L, 530L, 483L, 482L, > > 406L, 451L, 422L, 403L, 393L, 396L, 348L, 367L, 428L, 345L, 384L, > > 330L, 342L, 312L, 313L, 323L, 328L, 340L, 322L, 330L, 305L, 311L > > )), .Names = c("theta", "int&quo

Re: [R] need for help for solving operations in a vector

2015-12-28 Thread PIKAL Petr
42L, 312L, 313L, 323L, 328L, 340L, 322L, 330L, 305L, 311L )), .Names = c("theta", "int"), row.names = 100:200, class = "data.frame") > Cheers Petr From: Makram Belhaj Fraj [mailto:belhajfraj.mak...@gmail.com] Sent: Tuesday, December 29, 2015 5:54 AM To: PIKAL Pet

Re: [R] need for help for solving operations in a vector

2015-12-28 Thread PIKAL Petr
Hi On top of answers you have got here is some plotting you need to answer yourself plot(qWC1, col=(c(0, diff(qWC1))>=0 )+1) Which from those red points you want to be included in irrigation period? All of them? Only part? Which part? Based on your figures you probably will not get 100% correc

Re: [R] need for help for solving operations in a vector

2015-12-25 Thread Giorgio Garziano
I think that the rle() function may help you to tackle the problem in a more general way. https://stat.ethz.ch/R-manual/R-devel/library/base/html/rle.html Using William's suggested series: x <- c(2,2,3,4,4,4,4,5,5,5,3,1,1,0,0,0,1,1,1) > x [1] 2 2 3 4 4 4 4 5 5 5 3 1 1 0 0 0 1 1 1 rle.x <- rle

Re: [R] need for help for solving operations in a vector

2015-12-23 Thread William Dunlap via R-help
What answer do you want for the following data? x <- c(2,2,3,4,4,4,4,5,5,5,3,1,1,0,0,0,1,1,1) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Dec 22, 2015 at 11:34 PM, Makram Belhaj Fraj < belhajfraj.mak...@gmail.com> wrote: > Dear colleagues > i need your generous help to solve the fo

Re: [R] need for help for solving operations in a vector

2015-12-23 Thread David L Carlson
I don't think you know what your code is doing. First, do not use html emails, only plain text. Secondly, provide the data in a portable way with the dput() function: > dput(qWC1) c(75.6, 75.20617, 75.20617, 74.95275, 74.95275, 74.70059, 74.70059, 74.70059, 74.57498, 74.44968, 74.32469, 74.