Role of scale and environmental factors in regulation of community structure