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)
Following lines create powerboat.rda
, residing in the data/
directory of the package.
save(powerboat_table,powerboat,powerboat_maxp,file="powerboat.rda")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.