Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions CONTRIBUTING.md

This file was deleted.

13 changes: 13 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,16 @@ To run [the app we're running remotely](http://daattali.com/shiny/bingo/) on you
launch()
```


## Contribute your own squares

We happily accept contributions to our collection of bingo cards! If you'd like to add a card, simply submit a [pull request](https://help.github.com/articles/using-pull-requests) following these guidelines:

- Create an R file under the [`inst/topics/`](./inst/topics/) directory
- The name of the R file will be used as the name of the topic of bingo cards
- The file should return a character vector containing the words or phrases to put in the squares
- **There should be at least 24 squares**, in order to make 5 x 5 bingo cards.
- Optional: at the top of the file, add your name and a short description of the card as a comment
- You can look at the [existing examples](./inst/topics/)

We'll try to be as responsive as possible in reviewing and accepting pull requests. We appreciate your contributions!
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [SuperBowl Example](#superbowl-example)
- ["Open" and Bad Data Examples](#open-and-bad-data-examples)
- [Run Shiny app locally](#run-shiny-app-locally)
- [Contribute your own squares](#contribute-your-own-squares)

<!-- README.md is generated from README.Rmd. Please edit that file -->
bingo
Expand Down Expand Up @@ -118,3 +119,17 @@ To run [the app we're running remotely](http://daattali.com/shiny/bingo/) on you
``` r
launch()
```

Contribute your own squares
---------------------------

We happily accept contributions to our collection of bingo cards! If you'd like to add a card, simply submit a [pull request](https://help.github.com/articles/using-pull-requests) following these guidelines:

- Create an R file under the [`inst/topics/`](./inst/topics/) directory
- The name of the R file will be used as the name of the topic of bingo cards
- The file should return a character vector containing the words or phrases to put in the squares
- **There should be at least 24 squares**, in order to make 5 x 5 bingo cards.
- Optional: at the top of the file, add your name and a short description of the card as a comment
- You can look at the [existing examples](./inst/topics/)

We'll try to be as responsive as possible in reviewing and accepting pull requests. We appreciate your contributions!
6 changes: 6 additions & 0 deletions tests/testthat/test-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ test_that("duplicate squares are removed", {
x <- c("a", "a", "b")
expect_identical(c("a", "b"), vet_squares(x))
})


test_that("each topic contains 24+ unique values", {
x <- letters[1:23]
expect_error(bingo(words = x), "m >= n_sq is not TRUE")
})

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start on something that is clearly much needed.

I'd tackle this in a separate PR because it's bit of a job. Harder than editing the README. We need to assess the viability of everything below inst/topics/ in a way that produces a decent error message, i.e. actually identifies the culprit(s), if something is wrong.