set.seed(0)
knitr::opts_chunk$set(echo = TRUE)
library("hyper2")
library("magrittr")
options("digits" = 5)
knitr::include_graphics(system.file("help/figures/hyper2.png", package = "hyper2"))

To cite the hyper2 package in publications, please use @hankin2017_rmd. 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")

References {-}



RobinHankin/hyper2 documentation built on May 6, 2024, 4:25 p.m.