In this post, we will see how to resolve Max between the adjoining and the value just above in R [Similar to RETAIN in SAS] Question: Sample data: Trying to create a max_score column which for each id is the ...