Re: [R] get the sign of a value

2013-03-15 Thread MacQueen, Don
And as a footnote to the other replies, see help('Math',package='base') R's online help has a number of topics that are broader than that of a single function, and that relatively new useRs might not have seen yet. Examples include ?Distributions (compare with ?rnorm) and ?Startup -Don

Re: [R] get the sign of a value

2013-03-14 Thread Ben Tupper
Hi, On Mar 14, 2013, at 3:41 PM, Dimitri Liakhovitski wrote: > Hello! Can't figure it out - hope it's simple: > > # I have some value (can be anything), e.g.: > x = 12 > # I'd like it to become 1. > > # If the value is negative (again, it can be anything), e.g.: > y = -12 > # I'd like it to bec

Re: [R] get the sign of a value

2013-03-14 Thread Dimitri Liakhovitski
Thanks a lot, Sarah, - that's it! Never used it before! Dimitri On Thu, Mar 14, 2013 at 3:48 PM, Sarah Goslee wrote: > You might perhaps look at: > ?sign > > > On Thu, Mar 14, 2013 at 3:41 PM, Dimitri Liakhovitski > wrote: > > Hello! Can't figure it out - hope it's simple: > > > > # I have some

Re: [R] get the sign of a value

2013-03-14 Thread Sarah Goslee
You might perhaps look at: ?sign On Thu, Mar 14, 2013 at 3:41 PM, Dimitri Liakhovitski wrote: > Hello! Can't figure it out - hope it's simple: > > # I have some value (can be anything), e.g.: > x = 12 > # I'd like it to become 1. > > # If the value is negative (again, it can be anything), e.g.:

[R] get the sign of a value

2013-03-14 Thread Dimitri Liakhovitski
Hello! Can't figure it out - hope it's simple: # I have some value (can be anything), e.g.: x = 12 # I'd like it to become 1. # If the value is negative (again, it can be anything), e.g.: y = -12 # I'd like it to become -1. How could I do it? Thanks a lot! -- Dimitri Liakhovitski [[al