<p dir="ltr">Do you know what the output of the endpoints function is? It's trivial from there.</p>
<div class="gmail_quote">On Oct 28, 2015 12:35 PM, "Am Gut" <<a href="mailto:agquantr@gmail.com">agquantr@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Good Morning Everyone,<div><br></div><div>I have essentially two questions. I am trying to subset a an existing dataset based on the last two business days of each month in the dataset. I am able to subset based on the last business day of each month (or the last day as I am only using business days in my dataset) via the following code:</div><div><br></div><div><div>##identify second to last business day of every month</div><div>month_end = lookback_returns_nona[endpoints(lookback_returns_nona, on="months"),]</div></div><div><br></div><div>However, I do not have to make this the second to last day instead. In addition, can someone help me understand how I could do the last business day of each month and the second to last business day of each month?</div><div><br></div><div>My dataset simply contains a date index, and a few variables with daily returns:</div><div><br></div><div><br></div><div><img src="cid:ii_150af830821bd87c" alt="Inline image 1" width="323" height="87"><br></div><div><br></div><div>As a side note, I am new to the forum so please feel free to let me know if I am not observing proper posing rules. Thanks in advance as any help would be extremely useful.</div><div><br></div><div>Kind Regards,</div><div><br></div><div>AG</div></div>
<br>_______________________________________________<br>
<a href="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br>
<a href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" rel="noreferrer" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br>
-- Subscriber-posting only. If you want to post, subscribe first.<br>
-- Also note that this is not the r-help list where general R questions should go.<br></blockquote></div>