Relative Content

Tag Archive for rinterpolation

linear interpolation in R only to max depth and not fixed depth

In the example below, I can get a linear interpolation up to a fixed depth (30). For variable a, “1” only goes to a max depth of 25 whereas “2” goes to a max depth of 35. So for “1”, between 26 and 35 gets NA’s. Is there a way to stop interpolation based on maximum depth value? In which case, for “1” interpolation would go only to 25 and for “2” it will go to 30.