Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shiny jackpot #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

clean:
rm -f README.html shinyRGT/md/intro.html shinyRGT/md/help.html
rm -f README.html shinyRGT/md/intro.html shinyRGT/md/help.html shinyJackpot/md/intro.html
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## shinyapps
# shinyapps

<!-- badges: start -->
![](https://img.shields.io/badge/andr3wli-shinyapps-green)
Expand All @@ -7,10 +7,10 @@

These are some of the shiny applications that I have created. Each folder has its own README.

### [shinyJackpot](https://andrewcli.shinyapps.io/shinyJackpot/)
## shinyJackpot
An application to explore and visualize demographic and lottery ticket sales data in the greater Toronto area. This app is an upgrade to the first shiny app I ever made (Jackpot) Check out our [paper]() accompanying this app!

**Packages:** The application uses the following packages: [`shiny`](https://shiny.rstudio.com), [`tidyverse`](https://www.tidyverse.org), [`ggiraph`](https://davidgohel.github.io/ggiraph/articles/offcran/using_ggiraph.html), [`leaflet`](), [`shinythemes`](), and [`lottodata`](https://andr3wli.github.io/lottodata/). To see which versions of these pacshinyJackpot_draftkages are used and the dependencies, check the `session_info.txt` file in the app directory.
**Packages:** The application uses the following packages: [`shiny`](https://shiny.rstudio.com), [`tidyverse`](https://www.tidyverse.org), [`ggiraph`](https://davidgohel.github.io/ggiraph/articles/offcran/using_ggiraph.html), [`leaflet`](), [`shinythemes`](), and [`lottodata`](https://andr3wli.github.io/lottodata/). To see which versions of these packages are used and the dependencies, check the `session_info.txt` file in the app directory.

**Data sources:** The data for the lottery ticket sales were obtained from [Ontraio Lottery and Gaming Corporation](https://www.olg.ca/en/home.html) via a freedom of information act request. These data sets are freely available on [Open Science Framework](//osf.io/qwrxy/) and on [Github](https://github.com/andr3wli/lottodata). Geocoding was provided by [GeoCoder.ca](https://geocoder.ca).

Expand All @@ -26,7 +26,7 @@ Or you can access shinyJackpot via my shiny server here: https://andrewcli.shiny

<hr>

### [shinyRGT](https://andrewcli.shinyapps.io/shinyRGT/)
## shinyRGT
An application to easily tidy, explore and visualize rat gambling task data. As well, it can be especially useful for researchers using the RGT in tandem with DREADDs. Check out our [paper]() accompanying this app!

By: Andrew Li (UBC) and Georgios Karamanis (Uppsala)
Expand All @@ -45,7 +45,7 @@ Or you can access shinyRGT via my shiny server here: https://andrewcli.shinyapps

<hr>

### [Andrew's Shiny Bar](https://andrewcli.shinyapps.io/andrews_bar/)
## Andrew's Shiny Bar
My submission for STAT 545 at UBC. With everything being online because of COVID, use this bar to enjoy your favourite drink and bar snack.

**Packages:** The application uses the following packages: [`shiny`](https://shiny.rstudio.com), [`tidyverse`](https://www.tidyverse.org), [`shinyWidgets`](https://github.com/dreamRs/shinyWidgets), [`ggforce`](https://github.com/thomasp85/ggforce), [`geombeer`](https://github.com/andr3wli/geombeer).
Expand All @@ -62,7 +62,7 @@ Or you can access Shiny Bar via my shiny server here: https://andrewcli.shinyapp

<hr>

### [Jackpot](https://andrewcli.shinyapps.io/Jackpot/)
## Jackpot
An R shiny application to visualize lottery ticket sales and lottery ticket size in Toronto, Canada.

**Packages:** The application uses the following packages: [`shiny`](https://shiny.rstudio.com), [`plotly`](https://plotly.com/r/), [`lottodata`](https://andr3wli.github.io/lottodata/), [`tidyverse`](https://www.tidyverse.org).
Expand Down
12 changes: 10 additions & 2 deletions shinyJackpot/README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ knitr::opts_chunk$set(echo = TRUE)

**What is this app?** An application to explore and visualize demographic and lottery ticket sales data in the greater Toronto area. Check out our [paper]() accompanying this app.

**Packages:** The application uses the following packages: [`shiny`](https://shiny.rstudio.com), [`tidyverse`](https://www.tidyverse.org), [`ggiraph`](https://davidgohel.github.io/ggiraph/articles/offcran/using_ggiraph.html), [`leaflet`](), [`shinythemes`](), and [`lottodata`](https://andr3wli.github.io/lottodata/). To see which versions of these packages are used and the dependencies, check the `session_info.txt` file in the app directory.
**Directory:**

* `app.R` contains the frontend and backend code needed to generate shinyJackpot
* `css` contains code for the map tab
* `data` contains all the resulting tidy data used for the app
* `data_wrangling` contains R code that was udsed to generate the clean data
* `md` contains the markdown files and images needed to generate this README and the intro tab
* `untidy_data` contains CSV files to be cleaned
* `session_info.txt` contains information about the packages and there dependencies for this app

**Data sources:** The data for the lottery ticket sales were obtained from [Ontraio Lottery and Gaming Corporation](https://www.olg.ca/en/home.html) via a freedom of information act request. These data sets are freely available on [Open Science Framework](//osf.io/qwrxy/) and on [Github](https://github.com/andr3wli/lottodata). Geocoding was provided by [GeoCoder.ca](https://geocoder.ca).

Expand All @@ -22,7 +30,7 @@ knitr::opts_chunk$set(echo = TRUE)
shiny::runGitHub(repo = "andr3wli/shinyapps", subdir = "shinyJackpot")
```

Alternatively, it is available on my Shiny server: [ADD LINK TO SHINY APP HERE]()
Alternatively, it is available on my Shiny server: [ADD LINK TO SHINY APP HERE](shiny::runGitHub(repo = "andr3wli/shinyapps", subdir = "shinyJackpot")

![map](md/map_screenshot.png)
![cor](md/cor_screenshot.png)
Expand Down
8 changes: 6 additions & 2 deletions shinyJackpot/md/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<br>

### What is this app?
<!--### What is this app?
This shiny application was created as supplementary marterial for our paper **ADD TITLE OF THE PAPER HERE**. <br><br>
This app allows users to explore the data interactively. You can find the data on [Open Science Framework](https://osf.io/qwrxy/). Alternatively, you can download [lottodata](https://github.com/andr3wli/lottodata) - an R data package which provides easy access to the data sets. Future development plans for this app include adding different types of lottery games (scratch card tickets and fixed prize games). <br><br>
By: [Andrew Li](http://andrewcli.me) (UBC), [Hin Hgai Fu](https://ottolab.persona.co) (McGill), [Ross Otto](https://ottolab.persona.co) (McGill), [Luke Clark](https://psych.ubc.ca/profile/luke-clark/) (UBC). <br><br>
Expand All @@ -25,7 +25,11 @@ ADD THE BIBTEX CITATION HERE
<br>
<h5 style="color:grey;"> Notes </h5>

<p style="color:grey;"> The demographic data and lottery data were obtained from the <a href= "https://www.olg.ca/en/home.html"> Ontraio Lottery and Gaming Corporation </a> via an Access to Information Act request. Currently, the data sets are openly availble on <a href = "https://osf.io/qwrxy/"> OSF </a> and <a href = "https://github.com/andr3wli/lottodata"> Github. </a> Geocoding was provided by <a href="https://geocoder.ca"> GeoCoder.ca</a>. All artwork are from the <a href = "https://thenounproject.com"> Noun Project.</a> Thanks to Joel Le Forestier for helping with the relationship tab. </p>
<p style="color:grey;"> The demographic data and lottery data were obtained from the <a href= "https://www.olg.ca/en/home.html"> Ontraio Lottery and Gaming Corporation </a> via an Access to Information Act request. Currently, the data sets are openly availble on <a href = "https://osf.io/qwrxy/"> OSF </a> and <a href = "https://github.com/andr3wli/lottodata"> Github. </a> Geocoding was provided by <a href="https://geocoder.ca"> GeoCoder.ca</a>. All artwork are from the <a href = "https://thenounproject.com"> Noun Project.</a> Thanks to Joel Le Forestier for helping with the relationship tab. </p> -->

### Introduction

Lottery gambling is widely enjoyed by Canadians and is the most popular form of legal gambling. As such, discovering and analyzing patterns in lottery gambling data is an important but nontrivial task. In this work, three methods were presented to process and visualize it to the end user to allow for faster pattern discovery. A bubble graph was utilized for the comparative analysis of lottery sales per each neighbourhood of the city of Toronto, Canada. As well, a scatter plot was used to explore the relationship between different neighbourhoods, lottery game product, year, lottery ticket sales, and demographic information. Lastly, a line graph was deployed to compare the jackpot size and ticket sales over time.

<p style="color:grey;"> This app was built with ❤️ and ☕️ by <a href = "http://andrewcli.me"> Andrew Li</a> | View the source code <a href = "g"> here </a> </p>

Expand Down
51 changes: 51 additions & 0 deletions shinyRGT/README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "shinyRGT"
output: github_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

<!-- badges: start -->
![](https://img.shields.io/badge/andr3wli-shinyRGT-green)
![](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Fdrewroc6)
<!-- badges: end -->

<h1 id="logo"> <img width = "100" height = "100" src="md/rat.png" alt="logo"/> Rat Gambling Task</a> </h1>

#### What is this app?
A GUI to easily tidy, explore and visualize rat gambling task data. As well, it can be especially useful for researchers using the RGT in tandem with DREADDs. Check out our [paper]() accompanying this app.

#### Directory
* `app.R` contains the R code that generates shinyRGT
* `md` contains the markdown files and images needed for the README and for the intro tab
* `session_info.txt` contains information about the packages and there dependencies for this app

#### Launch application:
```{r}
shiny::runGitHub(repo = "andr3wli/shinyapps", subdir = "shinyRGT")
```

Alternatively, it is available on my Shiny server [here](https://andrewcli.shinyapps.io/shinyRGT/)

#### Citation
If you find this work helpful, please cite our work. Thanks!
```
ADD THE BIBTEX CITATION HERE
```

#### Examples

**Data Wrangling:**
![wrangling](md/wrangling.gif)

**Data Visualization:**
![viz](md/data_viz_rgt.png)


#### Related work and repositories

* ["Serotonergic and dopaminergic modulation of gambling behavior as assessed using a novel rat gambling task"](https://pubmed.ncbi.nlm.nih.gov/19536111/) in Neuropsychopharmacology
* ["Chemogenetic inhibition of dopaminergic projections to the nucleus accumbens has sexually dimorphic effects in the rat gambling task"](https://www.researchgate.net/profile/Tristan-Hynes/publication/342118840_Chemogenetic_inhibition_of_dopaminergic_projections_to_the_nucleus_accumbens_has_sexually_dimorphic_effects_in_the_rat_gambling_task/links/5efe3ed4299bf18816fcc825/Chemogenetic-inhibition-of-dopaminergic-projections-to-the-nucleus-accumbens-has-sexually-dimorphic-effects-in-the-rat-gambling-task.pdf) in Behavioral Neuroscience
* ["DREAADs for neuroscientists"](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4759656/) in Neuron
63 changes: 63 additions & 0 deletions shinyRGT/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
shinyRGT
================

<!-- badges: start -->

![](https://img.shields.io/badge/andr3wli-shinyRGT-green)
![](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Fdrewroc6)
<!-- badges: end -->

<h1 id="logo">
<img width = "100" height = "100" src="md/rat.png" alt="logo"/> Rat
Gambling Task</a>
</h1>

#### What is this app?

An application to easily tidy, explore and visualize rat gambling task
data. As well, it can be especially useful for researchers using the RGT
in tandem with DREADDs. Check out our [paper]() accompanying this app.

#### Packages

The application uses the following packages:
[`shiny`](https://shiny.rstudio.com),
[`tidyverse`](https://www.tidyverse.org), [`shinythemes`](), and
[`shinyWidgets`](https://github.com/dreamRs/shinyWidgets). To see which
versions of these packages are used and there dependencies, look at the
`session_info.txt` file in the repo directory.

#### Launch application:

``` r
#shiny::runGitHub(repo = "andr3wli/shinyRGT")
```

Alternatively, it is available on my Shiny server
[here](https://andrewcli.shinyapps.io/shinyRGT/)

#### Citation

If you find this work helpful, please cite our work. Thanks!

ADD THE BIBTEX CITATION HERE

#### Examples

**Data Wrangling:** ![wrangling](md/wrangling.gif)

**Data Visualization:** ![viz](md/data_viz_rgt.png)

#### Related work and repositories

- [“Serotonergic and dopaminergic modulation of gambling behavior as
assessed using a novel rat gambling
task”](https://pubmed.ncbi.nlm.nih.gov/19536111/) in
Neuropsychopharmacology
- [“Chemogenetic inhibition of dopaminergic projections to the nucleus
accumbens has sexually dimorphic effects in the rat gambling
task”](https://www.researchgate.net/profile/Tristan-Hynes/publication/342118840_Chemogenetic_inhibition_of_dopaminergic_projections_to_the_nucleus_accumbens_has_sexually_dimorphic_effects_in_the_rat_gambling_task/links/5efe3ed4299bf18816fcc825/Chemogenetic-inhibition-of-dopaminergic-projections-to-the-nucleus-accumbens-has-sexually-dimorphic-effects-in-the-rat-gambling-task.pdf)
in Behavioral Neuroscience
- [“DREAADs for
neuroscientists”](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4759656/)
in Neuron