Re: [R] Handling NA values in a if statement

2015-04-20 Thread Luigi Marongiu
Dear David and Mark, thank you for your reply. I have implemented the suggestions you have made in the following: x - c(-Inf, Inf,NA,5.9,6.08,5281391136138.75, 4.35,4.79, 9474097322.96,3.64,16.42,-12211.11,4.37, -1097.79,4.78,

Re: [R] Handling NA values in a if statement

2015-04-17 Thread Marc Schwartz
On Apr 17, 2015, at 5:23 PM, Luigi Marongiu marongiu.lu...@gmail.com wrote: Dear all, I have a vector with a certain range of values including infinity and NA. I would like to remove the values that are outside a given range (lower level = ll and upper level = ul) but I am getting the error

[R] Handling NA values in a if statement

2015-04-17 Thread Luigi Marongiu
Dear all, I have a vector with a certain range of values including infinity and NA. I would like to remove the values that are outside a given range (lower level = ll and upper level = ul) but I am getting the error due to the NA values (missing value where TRUE/FALSE needed). I then included the