If you only want a simple linear regression, you might also want to try xyplot(t~s|factor(lonLabels[whichLon100])*factor(latLabels[whichLat100]), + data=P100,pch=".", type =c("p","r") - type "r" will automatically fit and plot the regression line for you. Hadley