Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created February 21, 2022 12:25
Show Gist options
  • Select an option

  • Save MJacobs1985/306886c874a481f6276c8010ccdc4e33 to your computer and use it in GitHub Desktop.

Select an option

Save MJacobs1985/306886c874a481f6276c8010ccdc4e33 to your computer and use it in GitHub Desktop.
dfnew2%>%
filter(lcn_id%in%(901:909))%>%
xyplot(feed_provided_cum ~ curve_day|lcn_id*newField,.,
strip = FALSE, aspect = "xy", pch = 16, cex=0.5, grid = TRUE,
panel = function(x, y, ..., fit, subscripts) {
panel.xyplot(x, y, ...)
ypred1 <- fitted(fit.1)[subscripts]
panel.xyplot(x, ypred1, lty=1, col = "orange")
ypred2 <- fitted(fit.2)[subscripts]
panel.xyplot(x, ypred2, lty=1, col = "purple")
ypred3 <- fitted(fit.3)[subscripts]
panel.xyplot(x, ypred3, lty=1, col = "green")
ypred4 <- fitted(fit.4)[subscripts]
panel.xyplot(x, ypred4, lty=1, col = "brown")
ypred5 <- fitted(fit.5)[subscripts]
panel.xyplot(x, ypred5, lty=1, col = "red")
})
result<-augment(fit.1, conf.int=TRUE)
result%>%filter(lcn_id%in%(901:909))%>%
ggplot(., aes(x=feed_provided_cum, y=.fitted, colour=.resid))+
geom_point()+
theme_bw()+
facet_wrap(~lcn_id+newField)+
geom_abline(intercept=0, slope=1, lty=2, col="black")+
scale_color_viridis_c(option="turbo")
result<-augment(fit.2, conf.int=TRUE)
result%>%filter(lcn_id%in%(901:909))%>%
ggplot(., aes(x=feed_provided_cum, y=.fitted, colour=.resid))+
geom_point()+
theme_bw()+
facet_wrap(~lcn_id+newField)+
geom_abline(intercept=0, slope=1, lty=2, col="black")+
scale_color_viridis_c(option="turbo")
result<-augment(fit.4, conf.int=TRUE)
result%>%filter(lcn_id%in%(901:909))%>%
ggplot(., aes(x=feed_provided_cum, y=.fitted, colour=.resid))+
geom_point()+
theme_bw()+
facet_wrap(~lcn_id+newField)+
geom_abline(intercept=0, slope=1, lty=2, col="black")+
scale_color_viridis_c(option="turbo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment