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.
Please note that not every month has NA values.