Hey I have a dataset in this format:

Date(daily) var1 var2 var3 var4 var5


I only want to work with the value that each variable have the last day in each month
So for january I want the value for day 31, for february the value for day 28(unless leap year of course), and so on.

Also, if the last date in this month is a holiday and I have no value, can I make it use the last valid value for this month? Missing values are noted as NA instead of a number.