Dairy vs. plant-based milk: what are the environmental impacts?

A growing number of people are interested in switching to plant-based alternatives to dairy. But are they better for the environment, and which is best?