Minimum diameter spanning tree in R