I have received a transaction log where I track students logging into a Learning Management System (LMS). I have already managed to spread the data into weeks. The resulting data.frame looked as follows:
UserID 31 32 33 34 35
user1 active active n/a n/a active
user2 n/a n/a active active n/a
user3 active n/a n/a active active
I need to insert or replace the column values based on the preceeding value into something like below:
UserID 31 32 33 34 35
user1 new recur drop drop recur
user2 n/a n/a new recur drop
user3 new drop drop recur recur
This is to show students login patterns which differentiate between new user logging for the first time, recurring users and users who did not log in for a particular week.