ggchessboard: Plot a fen representation chessboard via ggplot2

Description Usage Arguments Value Examples

View source: R/ggchessboard.R

Description

Function to show the fen string in ggplot2.

Usage

1
2
3
  ggchessboard(fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
  cellcols = c("#D2B48C", "#F5F5DC"), perspective = "white",
  piecesize = 15)

Arguments

fen

Fen notation of a chessboard

cellcols

A 2 length vector fot the cell colors

perspective

A string to show the perspective (black, white)

piecesize

Size of the the unicode texts

Value

A ggplot object

Examples

1
2
3
4
5
6
7
8
ggchessboard()

ggchessboard(fen = "rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2")

ggchessboard(fen = "rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2",
             cellcols = c("#CCCCCC", "#FAFAFA"),
             piecesize = 17,
             perspective = "black")

jbkunst/rchess documentation built on Oct. 25, 2018, 5:31 p.m.