get_points: Get points from chess match results

View source: R/get_points.R

get_pointsR Documentation

Get points from chess match results

Description

This function takes a vector of chess match results as input and converts them to tournament points.

Usage

get_points(results)

Arguments

results

A vector of strings representing the results of chess matches.

Details

Each result should be one of the following strings: "0-1", "1-0", "1/2-1/2", or "*". The function returns 0, 1, 0.5, or NA respectively for each result. If a result is not one of these four strings, it throws an error.

Value

A numeric vector representing the points from the chess matches.

Examples

get_points(c("0-1", "1-0", "1/2-1/2", "*")) # returns c(0, 1, 0.5, NA)

dryguy/rbitr documentation built on Oct. 15, 2024, 6:18 a.m.