Create new column based on condition that exists within a rolling date
问题 To make this question more generalized, I believe it could also be rephrased as: Creating a rolling temporally sensitive factor variable . Though an uncommon requirement, this could be utilized for many different data sources. I have a series of non-uniform time data with > 1 record per day for thousands of users. I want to create a new column player_type that keeps track of a rolling 30 day definition of their behavior. The behavior is defined by what games they play; the column 'games' is a