Ecological speciation and phenotypic plasticity affect ecosystems