Package 'kgschart'

Title: KGS Rank Graph Parser
Description: Restore underlining numeric data from rating history graph of KGS (an online platform of the game of go, <http://www.gokgs.com/>). A shiny application is also provided.
Authors: Kota Mori [aut, cre]
Maintainer: Kota Mori <[email protected]>
License: MIT + file LICENSE
Version: 1.3.5
Built: 2025-01-25 02:48:32 UTC
Source: https://github.com/cran/kgschart

Help Index


Download KGS rank graph

Description

Access KGS server and download the latest rank graph of the specified player. Requires internet connection. Returns the path to the downloaded file if succeeded.

Usage

download_graph(id, dst = tempfile(), lang = "en", country = "US",
  method = "libcurl", ...)

Arguments

id

KGS ID

dst

destination file path or directory

lang

language code, a lower case character of length 2

country

country code, an upper case character of length 2

method

method to be used for downloading files. See download.file for details

...

optional arguments for download.file other than method and mode

Details

Default setting downloads the English version. Another good option is to set lang='ja' and country='JP', which downloads the Japanese version.

Value

path to the saved file

See Also

download.file

Examples

## Not run: 
f <- download_graph('twoeye')
p <- png::readPNG(f)
plot.new()
rasterImage(p,0,0,1,1)
## End(Not run)

KGS Rank Graph Parser

Description

Parse a KGS rank graph and recover undelining numeric data.

Usage

kgschart(src, keep_image = FALSE, ...)

Arguments

src

png file name

keep_image

if TRUE, keep image arrays, otherwise discarded

...

other arguments for readPNG

Value

kgschart class object

Examples

x <- kgschart(system.file("extdata/leela-ja_JP.png",
                          package = "kgschart"))
head(x$data)
## Not run: 
plot(x)
## End(Not run)

Launch shiny app

Description

Start "KGS Rank Graph Parser" applicaiton.

Usage

kgschart_app(...)

Arguments

...

optional arguments for runApp

Examples

## Not run: 
kgschart_app()
## End(Not run)

Plot method for kgschart object

Description

Plot data or image

Usage

## S3 method for class 'kgschart'
plot(x, y = NULL, image = FALSE, separate = FALSE, ...)

Arguments

x

kgschart class object

y

not in use

image

if TRUE, draw the image, otherwise plot the data

separate

if TRUE, and image is TRUE, draw the image separated by component. Useful for debugging.

...

not in use

Value

gtable object if image and separate are both TRUE, ggplot object otherwise


Print method for kgschart object

Description

Display basic information

Usage

## S3 method for class 'kgschart'
print(x, ...)

Arguments

x

kgschart class object

...

not in use

Value

Nothing