merge tidy data with additional seg coding