Create distance.R