://dplyr.tidyverse.org/reference/sample.html'>sample</a></span>(<span class='no'>day_var</span>, <span class='fl'>12</span>, <span class='fl'>TRUE</span>)) <span class='kw'>%&gt;%</span>
 <span class='fu'><a href='https://dplyr.tidyverse.org/reference/arrange.html'>arrange</a></span>(<span class='no'>grp1</span>, <span class='no'>grp2</span>, <span class='no'>date</span>)

<span class='co'># pad by one grouping var</span>
<span class='no'>x_df_grp</span> <span class='kw'>%&gt;%</span> <span class='fu'>pad</