R scripts for ecological analyses