[Solved] R: replace the whole part of a number but keep the decimal part unchanged
The commenters are right. It doesn’t matter how long the list of numbers is. R can do the operation in one go. x <- c(25.01, 25.8, 25.4) x-15 [1] 10.01 10.80 10.40 If you do run into a situation with many wide-ranging numbers and need to literally keep what comes after the decimal and pick … Read more