I get the error below when trying to draw the lmline. This same error occurs weather the plot is base plot, lattice or ggplot. There isn't an NA or NAN in the column - it was scrubbed of that. But the log for Emission may have caused "inf" in some of the data. I suspect the issue to be with the lm function having problem with "inf" for obvious reasons. Is there a way to get around this?
model <- lm(log(Emissions) ~ year, outpoint) Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in 'y'
Note: if log isn't used - the lmline draws. I am doing this because the data is mushed and can be better presented with a log.
xyplot(log(y) ~ x | f, type = c("p","r"), panel = function(x, y,...) {
panel.xyplot(x, y, ...)
panel.lmline(x, y, ...)
}, xlab = "x label", ylab = "y label")
Get the following error in the plot.
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
NA/NaN/Inf in 'y'