Hi All,
I need your help in NA handling.
I've following data series.
x-c(1,4,5,8,NA,4,NA,5,5,1,2,7,8,9,NA,NA,NA,15,6,8)
Now i want to interpolate where NA value persists. Like, between 9 and 5 there
are three NA's. So, that should be interpolated like,
1st NA- (15-9)/4
2nd NA- 1st NA value +
Try this:
help.search(interpolate)
Then find this:
library(zoo)
na.approx(x)
[1] 1.0 4.0 5.0 8.0 6.0 4.0 4.5 5.0 5.0 1.0 2.0 7.0 8.0 9.0 10.5
[16] 12.0 13.5 15.0 6.0 8.0
Hth,
JeeBee.
On Thu, 22 Jun 2006 06:54:53 +0100, Sumanta Basak wrote:
Hi All,
I need your help in