Getting all the corresponding rows with max date in r
<p>I have the data frame similar to this but with 30 more variables </p>

<p><a href="https://i.stack.imgur.com/DWlXF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DWlXF.png" alt="Data frame "></a></p>

<p>i need only the corresponding values of max date for each "code" 
so the output should be like this </p>

<p><a href="https://i.stack.imgur.com/pzoXZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pzoXZ.png" alt="Required form"></a></p>

<p>Any experts can help me solving this please .</p>