Easy web publishing from R
Write
R Markdown
documents in RStudio.
Share them here on RPubs.
(It’s free, and couldn’t be simpler!)
Get Started
Recently Published
P10
Konsep dan Uji Hipotesis
Bayu Fachri (52260027)
Fa26Assignment4_Newton
# I found this data set online while searching for sports data sets. My dream is to work for a professional sports team some day, and this trellsicope package seemed like the perfect assignment to facet on franchises. The Lahman package has a handful of data sets, and the one I decided to use is called "Teams." This data set contains 3075 observations of 48 variables. Each row represents a single season for a MLB franchise dating all the way back to 1876. I decided to do a small amount of data cleaning to ensure my future scatterplots were well represented by filtering by franchises that had at least 20 seasons of data. I faceted on each Franchise to get 30 separate scatterplots to see how each compare with one another throughout their history's.
# I created two customs variables for this assignment. The first was a simple win percentage for each row that divided wins by total games. This variable would end up being the y variable for the scatterplots. I wanted to investigate winning trends throughout the years of franchises and needed to account for the fact that the total number of games in a season was not constant since 1876. The second measure I created did not change by year, rather was constant for each individual franchise. For each of the 30 franchises, I calculated the percentage of "winning" seasons, or percent of seasons that had a winning percentage over .500. For example, one of the best franchises of all time, the Los Angeles Dodgers, have a winning season percentage of 66%. The Colorado Rockies on the other hand, have had winning seasons just 38.1% of their existence. This measure can be toggled on by clicking it on the left most side under filters, and it will appear under each franchID. A user could investigate current teams, both good and bad, and see how their current success aligns with their historical success. At the same time, you are able to see which franchises typically remain around .500 and which had extremely good and awful seasons. I went with a 2 by 2 configuration so you could easily make comparisons between the franchises. I found that more than 4 on a page was not beneficial and any less did not use the space available effectively.
# The most difficult part of this assignment was finding a data set. I first searched on data camp before resorting to google for sports data sets. Once I found the Lahamn package, it became very clear and obvious what I could represent with franchise data. I knew I wanted to explore historical winning trends among the 30 franchises and see if the prestigious teams of today were really that much better throughout history. I did not originally plan to show team names for each franchise, but by using the color = function in ggplot, I was also able to show each franchises team names and how the team performed under each name, which I think adds a lot to the visuals. You can easily see which franchises have never re branded and which have changed numerous times. This was a really fun assignment!
Bike Theft in Vancouver
Interactive map of bike reported bike theft in Vancouver