I am writing program in R. I stuck here.
I have vector like
X=c(84.05, 108.04, 13.95, -194.05, 64.03, 208.05, 84.13, 57.04)
I want to get a vector after replacing all elements of this vector which are >180 by 180 and all elements which are less than <-180 by -180.
Like I want to get,
X=c(84.05, 108.04, 13.95,-180, 64.03, 180, 84.13, 57.04)
How to do this??
The vector which I am working is very large.
Try using
pmin
Benchmark