Maintainer: | Steven E. Pav <shabbychef@gmail.com> |
Version: | 0.2.3 |
Date: | 2023-07-18 |
License: | LGPL-3 |
Title: | 'shiny' App to Discover Cocktails |
BugReports: | https://github.com/shabbychef/cocktailApp/issues |
Description: | A 'shiny' app to discover cocktails. The app allows one to search for cocktails by ingredient, filter on rating, and number of ingredients. The package also contains data with the ingredients of nearly 26 thousand cocktails scraped from the web. |
Depends: | R (≥ 3.0.2), shiny |
Imports: | shinythemes, dplyr, tidyr, tibble, ggplot2, magrittr, ggtern, forcats, DT |
Suggests: | testthat |
URL: | https://github.com/shabbychef/cocktailApp |
Collate: | 'cocktailApp.r' |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2023-07-18 17:27:54 UTC; spav |
Author: | Steven E. Pav |
Repository: | CRAN |
Date/Publication: | 2023-07-19 13:40:09 UTC |
Shiny app to discover cocktails.
Description
Shiny app to discover cocktails.
Legal Mumbo Jumbo
cocktailApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Note
This package is maintained as a hobby.
Author(s)
Steven E. Pav shabbychef@gmail.com
cocktailApp .
Description
A shiny
app to explore cocktails. The app allows you to enter ingredients
that a cocktail must have, or ingredients that it must not have. One can
filter by number of ingredients, minimum rating, minimum ‘t stat’
(computed as the rating minus the T stat zero all multiplied by the square
root of the number of ratings). One can also search for cocktail by regex.
In the main tab, titled “drinks”, one can find a table with the summaries of matching cocktails. Selecting rows of this table will cause the cocktail table below to be populated with more details on each selected cocktail. Selecting rows will also populate the bar chart in the “plots” tab.
If two or more ingredients are selected, drinks with non-zero quantities of both of these will be shown in a ternary plot in the “tern” tab.
In the “other” tab is a table with common co-ingredients of the selected ingredients. A co-ingredient is an ingredient that commonly occurs with the selected ingredient, as measured by the number of cocktails, and by ‘rho’, which is like a correlation based on the proportion.
A checkbox labelled, “Hobson's Choice” allows you to populate the cocktail table with five random cocktails that meet the numerical filters on number of ingredients, rating, and so on, but which do not meet the ingredient selections. Unselecting and re-selecting the checkbox selects a new set of random cocktails. Note that the random selection is not responsive to changes in the numerical filters.
Usage
cocktailApp(page_title = "Drink Schnauzer", enableBookmarking = "url")
Arguments
page_title |
an optional page title for the app. A |
enableBookmarking |
Can be one of |
Value
Runs the shiny
app.
Screenshots
The main page looks as follows. In this case the user has selected two ingredients, ‘Benedictine’ and ‘Bourbon’. The user has modified some of the numeric filters resulting in only six cocktails in the cocktail table on the right in the main tab.
In the next screenshot, the user has selected two of the rows of the cocktail table, which causes the ingredients table on the lower right to be populated with the recipes of the selected cocktails. Instead one could click on the linked cocktail names to be taken to the upstream source of the recipe, which is recommended since those pages typically have better instructions.
In the following screenshot, the user has selected two ingredients, ‘Benedictine’ and ‘bourbon’, then clicked on the the main table, then selected the ‘plots’ tab. This shows a bar plot of the proportions of all ingredients in all the selected cocktails.
In this screenshot, the user has selected two ingredients, ‘Benedictine’ and ‘bourbon’, then clicked on the ‘ternary’ tab, which shows a ternary plot of the proportions of cocktails with non-zero proportions of the first two selected ingredients. The third dimension of the ternary plot is ‘other’ ingredients.
In this screenshot, the user has checked the “Hobson's Choice” box, which adds 5 random cocktails to the cocktail table.
Author(s)
Steven E. Pav shabbychef@gmail.com
Examples
## Not run:
cocktailApp()
## End(Not run)
News for package 'cocktailApp':
Description
News for package ‘cocktailApp’
cocktailApp Version 0.2.3 (2023-07-18)
fix bug where you could not search for Gin or Vodka.
package had been archived because of dependency on ggtern.
convert citEntry to bibentry
cocktailApp Version 0.2.2 (2021-04-01)
merge many short ingredients.
fix some units in webtender data.
search by ingredient regex.
cocktailApp Version 0.2.1 (2019-07-01)
CRAN fix as tests were hanging.
replace
Ternary
package withggtern
.
cocktailApp Version 0.2.0 (2018-08-19)
adding another source.
adding “Hobson's Choice” button.
removing dependency on
ggtern
package, replacing withTernary
.
cocktailApp Initial Version 0.1.0 (2018-07-05)
first CRAN release.
Cocktails Data
Description
Ingredients of over 26 thousand cocktails, scraped from the web.
Usage
data(cocktails)
Format
A data.frame
object with around 117,000 rows and 12 columns. The
data were scraped from four websites: Difford's guide, Webtender, and
Kindred Cocktails, all scraped in late 2017; and Drinks Mixer, scraped in
mid 2018.
The columns are defined as follows:
amt
The numeric amount of the ingredient.
unit
The unit corresponding to the amount. The most common entry is
fl oz
, which is the unit for ‘main’ ingredients. The second most common entry isgarnish
. These two units account for over 95 percent of the rows of the data.ingredient
The name of the ingredient. These may have odd qualifiers, or brand specifications. Some of these qualifications are stripped out in the
short_ingredient
field.cocktail
The name of the cocktail.
rating
The rating assigned to the cocktail in the upstream database. For some sources, the ratings have been rescaled. Ratings are on a scale of 0 to 5.
upstream_id
An ID code from the upstream source.
url
The upstream URL.
votes
The number of votes in the rating, from the upstream database. Not always available.
added
The date the cocktail was added to the upstream database. Not always available.
src
The source of the cocktail, as listed in the upstream database. Usually not available.
short_ingredient
A shortened form of the ingredient, stripping away some of the qualifiers. This is subject to change in future releases of this package, when a better term extraction solution is found.
proportion
For ingredients where the
unit
isfl oz
, this is the proportion of the given cocktail that consists of the given ingredient. For a given cocktail, the proportions should sum to one.
Note
The data were scraped from several websites, which falls in a legal gray area. While, in general, raw factual data can not be copyright, there is a difference between the law and a lawsuit. The package author in no way claims any copyright on this data.
Source
Difford's Guide, https://www.diffordsguide.com/, Webtender, https://www.webtender.com, Kindred Cocktails, https://kindredcocktails.com, Drinks Mixer, http://www.drinksmixer.com.
Examples
data(cocktails)
str(cocktails)
require(dplyr)
cocktails %>%
filter(short_ingredient %in% c('Averna','Bourbon')) %>%
group_by(cocktail,url) %>%
mutate(isok=n() > 1) %>%
ungroup() %>%
filter(isok) %>%
arrange(desc(rating),cocktail) %>%
select(cocktail,ingredient,amt,unit,rating) %>%
head(n=8)