I'm trying to filte some daily panel ,but I just want to use the month end data,first I must know their month end date.
data example: https://i.stack.imgur.com/Qzhlr.jpg
I tried to use this code to get the month end date.However,some dates are missed (Some month end days are 24/25/26,I missed many data) My problems is,how can I get the data month end date and not ignore any earlier last day(like3/23,6/25,etc.)
library(anytime)
x=anydate(as.vector(fundbv$date))
y=unique(as.Date(format(mydates+28,"%Y-%m-01"))-1)
finaldays=x[x %in% unique(as.Date(format(x+28,"%Y-%m-01"))-1)]
finaldays=unique(finaldays)
Thanks and appreciate!!!!!