I was wondering how to fix this bit of code I have. I am trying to make 11 plots and save the information for the fit for each plot, but when I try to graph the line of best fit, I get the following error:
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
invalid a=, b= specification
In addition: Warning message:
In int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
NAs introduced by coercion
Here is my code:
for(n in 2:12){
nam<-paste("fit", n, sep = "")
assign(nam, lm(profilin[101:135,n]~profilin[101:135,1]))
plot(profilin[101:135,1], profilin[101:135,n], ylim=c(200,450), xlab="Time", ylab="Flourecence", col=cl[n-1])
abline(nam)
legend("topleft", legend=c(colnames(profilin)[n]), col=c(cl[n-1]), lwd=1)
}
Here is also a bit of my data:
profilin <- structure(list(Time = c(1500L, 1515L, 1530L, 1545L, 1560L, 1575L,
1590L, 1605L, 1620L, 1635L, 1650L, 1665L, 1680L, 1695L, 1710L
), ActinOnly = c(357.03, 353.37, 350.22, 367.78, 367.1, 361.02,
374.11, 371.67, 371.84, 379.44, 375.77, 377.25, 372.13, 385.1,
386.98), p0_5uM = c(341.37, 331.86, 341.82, 341.58, 349.91, 351.02,
353.87, 354.51, 353.64, 342.91, 355.29, 351, 354.67, 361.42,
363.92), p1uM = c(336.23, 335.37, 324.01, 347.67, 343.42, 343.42,
330.55, 358.45, 335.15, 321.5, 342.23, 353.56, 337.57, 360.57,
350.06)), row.names = 101:115, class = "data.frame")
cl <- rainbow(ncol(profilin)-1)