Displaying 1 result from an estimated 1 matches for "staterout".
Did you mean:
stateroute
2011 Nov 09
3
Help with tryCatch with a for loop
...data<-read.csv(file.choose(),sep=",",header=T)
#File name is cbc.subset
data$location.code = as.character(data$location.code)
locs = unique(location.code)
pdf("mygraphs.pdf",height=8, width=10)
par(mfrow=c(3,4))
for(s in 1:length(locs)){
#To plot data from a particular stateroute:
sub.ECDO<-data[data$location.code == locs[s],]
plot(abund~year, data=sub.ECDO, main=locs[s])
#To plot the linear model for the specified location:
lmodel<-lm(abund~year, data=sub.ECDO)
abline(lmodel$coefficients[1],lmodel$coefficients[2],lty=2)
#To plot the polynomial model f...