This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' extract parameters from roxygen tags | |
#' | |
#' extract parameters from roxygen tags | |
#' | |
#' @param n Namespace | |
#' @param f Function | |
#' | |
#' @importFrom tools Rd_db | |
#' @importFrom jsonlite fromJSON | |
#' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Data creation | |
## | |
## Create a large Excel spreadsheet as a asynchronous process | |
## | |
library(shiny) | |
## Temporary files to store log, script, rds data and excel output | |
logfile <- tempfile() | |
scriptfile <- tempfile() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Data creation | |
## | |
## Create a large Excel spreadsheet within a Shiny app | |
## | |
library(shiny) | |
library(openxlsx) | |
## Create a dummy matrix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Authentication | |
## This is a small app to demonstrate user-managed authentication using a hash to encode passwords. | |
## Users are stored in a SQL database with passwords along with roles. | |
## Once a user is logged in the shiny app responds to the user's role. | |
## In order to use in a real setting, additional code for password management, | |
## changing and resetting would need to be implemented. | |
library(shiny) | |
library(RSQLite) | |
library(sodium) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Authentication | |
## This is a small app to demonstrate user-managed authentication without encoded passwords. | |
## Users are stored in a SQL database with passwords along with roles. | |
## Once a user is logged in the shiny app responds to the user's role. | |
## In order to use in a real setting, additional code for password management, | |
## changing and resetting would need to be implemented. | |
library(shiny) | |
library(RSQLite) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Player | Team | Points | Cost | Pos | |
---|---|---|---|---|---|
Cech | Arsenal | 159 | £5.5 | GLK | |
Courtois | Chelsea | 69 | £5.5 | GLK | |
Hart | Man City | 134 | £5.5 | GLK | |
de Gea | Man Utd | 142 | £5.5 | GLK | |
Lloris | Spurs | 140 | £5.5 | GLK | |
Ospina | Arsenal | 20 | £5.0 | GLK | |
Begovic | Chelsea | 55 | £5.0 | GLK | |
Robles | Everton | 46 | £5.0 | GLK | |
Stekelenburg | Everton | 57 | £5.0 | GLK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Scraping HML | |
## use follow_link to read subsequent pages | |
## continue reading and scraping tables until 'Next' link does not respond | |
## table scraped by column so that max information can be teased out | |
## | |
library(rvest) | |
library(data.table) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## beerList | |
## | |
library(xml2) | |
library(stringr) | |
##url <- "http://www.craftbeercellar.com/belmont/beers.php?sort=country" ## Belmont location | |
url <- "http://www.craftbeercellar.com/winchester/beers.php?sort=country" ## Winchester location | |
html <- read_html(url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## transferWatch | |
## | |
## Monitor fantasy premierleague player list for updates during transfer window. | |
## Send a pushbullet notification when the player list has changed. | |
## Run as a cron job to send updates at regular intervals | |
## | |
## crontab: | |
## 0 * * * * Rscript $HOME/codes/transferWatch/transferWatch.R | |
## run every hour |