I have a daily price series. but some values in the price is NA and i want to replace it with that month's mean price value. I tried to run a for and if loop, but fail to deal with this.
Any help will be greatly appreciated.
its not clear what representation of time series you are using. and particular package/class involved?
Could you share representative data here ? perhaps use dput(yourobjectname) so you can copy and paste it as runnable code.