Category Archives: R

Ranking NHL’s best shooters with Bayesian multilevel modeling

In this post I will look at the question of who have been the best shooters in the NHL. The metric I will use is the shooting percentage, which is the number of goals scored divided by the number of … Continue reading

Posted in R, R-bloggers, sports | Comments Off on Ranking NHL’s best shooters with Bayesian multilevel modeling

Convenient plotting of distribution shapes in R

I needed to compare the shapes of a few distributions, and therefore wanted an easy way to plot them in R. For example, the standard normal can be plotted quickly enough with curve(dnorm(x, mean=0, sd=1), from=-3, to=3). But when comparing … Continue reading

Posted in R | Comments Off on Convenient plotting of distribution shapes in R

How good is Patrik Laine’s shot?

Patrik Laine is playing his first season in the NHL and currently leads the league in scoring with 12 goals. With 51 shots on goal, his shooting percentage is 23.5 %. How does this number compare to great goal scores over … Continue reading

Posted in R, sports | Comments Off on How good is Patrik Laine’s shot?

Boat trips and weather observations

Another boating season is over, so I updated the shiny app of my boat trips with another year’s worth of Moves app data. I also added weather and wave observations from the API of the Finnish Meteorological Institute. Clicking on … Continue reading

Posted in R, sailing, transportation | Comments Off on Boat trips and weather observations

Finland’s dependency ratio and pension contributions

In March, I made simple visualizations of Finland’s population structure and statutory pension contributions. I also made a third one, combining the two topics, but never posted it. Here it is. Shown in white is the aged dependency ratio, which … Continue reading

Posted in R | Comments Off on Finland’s dependency ratio and pension contributions

Finland’s mandatory pension contributions

A couple of weeks ago, I made an animated visualization of the population structure of Finland. Here’s another plot exploring demographic changes, this time coupled with the economy. Finland has a defined-benefit and earnings-related statutory pension system. Employers are required … Continue reading

Posted in R | Comments Off on Finland’s mandatory pension contributions

Population Structure of Finland

Inspired by the blog post Japan’s aging population, animated with R by David Smith and the population pyramid plot by Kyle Walker, I figured I’d try the same for Finland. I used the pxweb package (by Måns Magnusson, Love Hansson, … Continue reading

Posted in R | Comments Off on Population Structure of Finland

Snowplows of Helsinki

As part of the Helsinki Region Infoshare initiative, the city of Helsinki provides an API that shows the locations, routes, and activities of snowplows that are operated by its service provider Stara. Using that API, Sampsa Kuronen created Aurat kartalla, … Continue reading

Posted in R, transportation, urban | Comments Off on Snowplows of Helsinki

Mapping my boat trips

Now, in the middle of winter and when I’m a feeling bit under the weather, it’s a perfect moment to reminisce about summer and time spent on the Finnish Archipelago Sea. So, I combined tracking data from the Moves app … Continue reading

Posted in R, sailing | Comments Off on Mapping my boat trips

ggplot 2.0 and the missing order aesthetic

Version 2.0 of the popular R package ggplot2 was released three weeks ago. When I was reading the release notes, I largely just skipped over this entry under Deprecated features: The order aesthetic is officially deprecated. It never really worked, … Continue reading

Posted in R | Comments Off on ggplot 2.0 and the missing order aesthetic