# Trends in run scoring – comparing the leagues

[This article was first published on

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

**Bayes Ball**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

My previous two posts have looked a using R to create trend lines for the run scoring environments in the American and National leagues. This time around, I'll plot the two against each other to allow for some comparisons.

(The code below assumes that you've read the data into your workspace and calculated the LOESS trend lines, as I did in the previous two posts.)

One of the things I quickly appreciated about the R environment is the option to quickly compare and manipulate (for example, multiply) data from two different source files without having to cut-and-paste the data together. For everything in this post, we've got two data tables (one for each league) and they remain separate.

Read more »

To

**leave a comment**for the author, please follow the link and comment on their blog:**Bayes Ball**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.