read_boards: Translate Text File to Board Objects

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Translate Text File to Board Objects

Usage

1

Arguments

file

Path to text files that will be read in using readLines(). The vector of character strings will contain correctly encoded boards, with a separator "—-" placed before and after each board.

If the file's overal format does not meet the expectation, an error will be thrown. If the file is formatted correctly overall, but a board has invalid encoding, no error will occur but the board will be returned as NA rather than a board object.

Value

A list of board objects (or NA for invalid boards).

Examples

1
read_boards("https://raw.githubusercontent.com/benjaminleroy/36-350-summer-data/master/Week5/percolation_write_example.txt")

lilinhonglexie/percolate documentation built on Nov. 4, 2019, 4:32 p.m.