powerboat

set.seed(0)
knitr::opts_chunk$set(echo = TRUE)
library("hyper2")
library("magrittr")
options("digits" = 5)

powerboat racing is an important and prestigious sport. Here I analyse a dataset taken from the 2018 F1 Powerboat world championships.

powerboat_table <- read.table("powerboat.txt",header=TRUE)

We need some data cleaning first; specifically a zero entry is treated as "did not start":

powerboat_table[powerboat_table==0] <- "DNS"
powerboat_table[20:21,8] <- 0  # above does not apply to points
powerboat_table

Each row is a driver and each column a venue (apart from the final column, which is points scored). Thus we see from the first column that, in Portugal, Torrente came first, Stark second, T. AlQamzi second, and so on.

In this form we can easily convert to a support function:

powerboat <- ordertable2supp(powerboat_table[,1:7])
head(powerboat)
(powerboat_maxp <- maxp(powerboat))
pie(powerboat_maxp)
par(pty="s")
points <- as.numeric(powerboat_table[,8])
names(points) <- rownames(powerboat_table)
points
points <- points[order(names(points))]
points
plot(powerboat_maxp,points*max(powerboat_maxp)/max(points),xlab="likelihood",ylab="points",pch=16)
abline(0,1)

Package dataset

Following lines create powerboat.rda, residing in the data/ directory of the package.

save(powerboat_table,powerboat,powerboat_maxp,file="powerboat.rda")


Try the hyper2 package in your browser

Any scripts or data that you put into this service are public.

hyper2 documentation built on March 4, 2021, 9:09 a.m.