SQL and R for first_edits.