Commit af8fefe8 authored by ashtondrew's avatar ashtondrew

add dependencies file

parent 179bbdf8
......@@ -6,6 +6,7 @@
# R version 3.3.2 (2016-10-31)
# Libraries, Data, and Source Code ----
source(dependencies.R)
library(shiny) #Version 1.0.3
library(readr) #Version 1.1.1
......@@ -1538,18 +1539,10 @@ server <- function(input, output) {
paste0("RecoveryExplorer_",Sys.Date(),".pptx")
}, # the document to produce
content = function(file){
# Creation of doc, a pptx object (default template)
# Creation of doc, a pptx object
# use custom template
#doc <- pptx(template="C:/P_SESYNCapp/DecisionTheater/SESYNC/www/SESYNC_template.pptx")
doc <- pptx(template = 'www/SESYNC_template.pptx')
# or use use default template
# doc <- pptx()
# check my layout names:
#slide.layouts(doc)
# find names of components within a layout
#slide.layouts(doc, 'YG360_TitleSingleContent')
# Add Title Page slide
doc <- addSlide( doc, slide.layout = 'Title Slide' )
doc <- addTitle( doc, "Recovery Data Explorer")
......@@ -1574,23 +1567,16 @@ server <- function(input, output) {
writeDoc( doc, file )
})
################
################
# GENERATE Word REPORT
################
################
# Generate Word Report ----
output$DOC_report <- downloadHandler(
filename = function() {
paste0("RecoveryExplorer_", Sys.Date(),".docx")
}, # the document to produce
content = function(file){
# Creation of doc object (default template)
# Creation of doc object
doc <- docx(title = "demo")
#
# # Display available styles
# # styles(doc)
#
# Add Document title
doc <- addParagraph( doc,
paste0("Sample SESYNC Recovery Explorer Report"), stylename = "Titre")
......
# This code was provided by SESYNC to ensure dependencies captured during transfer to their servers
# List the package and version as below
dependencies <- read.csv(textConnection("
Package, Min.Version
shiny, 1.0.3
readr, 1.1.1
magrittr, 1.5
plyr, 1.8.4
dplyr, 0.7.8
tidyr, 0.6.3
forcats, 0.2.0
ggplot2, 2.2.1
scales, 0.4.1
DT, 0.2
ReporteRs, 0.8.8
"), stringsAsFactors = FALSE, strip.white = TRUE)
## No changes necessary below. ##
# Import installed package versions
pkgs <- installed.packages()
rownames(pkgs) <- c()
pkgs <- data.frame(pkgs, stringsAsFactors = FALSE)
# Compare requirements to installed packages
pkgs <- merge(dependencies, pkgs, by="Package", all.x=TRUE)
# Filter out packages meeting minimum version requirement
pkgs <- pkgs[mapply(compareVersion, pkgs$Min.Version, pkgs$Version) > 0, ]
# Install missing and newer packages
lapply(pkgs$Package, install.packages, repos="http://cran.us.r-project.org")
# Require dependencies [optional]
lapply(dependencies$Package, require, character.only=TRUE)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment