Re: [R] Help with abs function

2015-06-14 Thread Andrés Aragón Martínez
Hi, Just do the following: > tran<-c(7.2) > tgrid<-c(7.1,7.4,7.3,7.1,7.3) > tgrid<-tgrid-tran > tgrid [1] -0.1 0.2 0.1 -0.1 0.1 > abs(tgrid[tgrid>0.1]) [1] 0.2 Andrés > El 12/06/2015, a las 11:01, Jeff Newmiller > escribió: > > FAQ 7.31 > ---

Re: [R] Help with abs function

2015-06-12 Thread Jeff Newmiller
FAQ 7.31 --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engine

Re: [R] Help with abs function

2015-06-12 Thread Sarah Goslee
Please read R FAQ 7.31. On Fri, Jun 12, 2015 at 11:39 AM, Nelson, Gary (MISC) wrote: > I have come across some odd behavior (to me) using the abs() function that I > wonder if anyone can explain. > > Using R version 3.2.0, I created a vector of absolute values using the > following code: > >>

[R] Help with abs function

2015-06-12 Thread Nelson, Gary (MISC)
I have come across some odd behavior (to me) using the abs() function that I wonder if anyone can explain. Using R version 3.2.0, I created a vector of absolute values using the following code: > tran<-c(7.2) > tgrid<-c(7.1,7.4,7.3,7.1,7.3) > dgrid<-abs(tgrid-tran) > dgrid [1] 0.1 0.2 0.1 0.1