Create ‘trajectory.cluster.R’ file and function