| name | good-graphics | ||
|---|---|---|---|
| description | Good Graphics Principles. To be considered whenever a chart is being produced. | ||
| metadata |
|
Core Principles for Effective Communication
| #' extract parameters from roxygen tags | |
| #' | |
| #' extract parameters from roxygen tags | |
| #' | |
| #' @param n Namespace | |
| #' @param f Function | |
| #' | |
| #' @importFrom tools Rd_db | |
| #' @importFrom jsonlite fromJSON | |
| #' |
| ## 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() |
| ## Data creation | |
| ## | |
| ## Create a large Excel spreadsheet within a Shiny app | |
| ## | |
| library(shiny) | |
| library(openxlsx) | |
| ## Create a dummy matrix |
| ## 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) |
| ## 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) |
| 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 |
| ## | |
| ## 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) |
| ## | |
| ## 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) |
| ## | |
| ## 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 |