-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.R
56 lines (43 loc) · 2.21 KB
/
global.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# project libraries used
library(shinyAce)
library(shiny)
library(dplyr)
library(markdown)
library(rmarkdown)
library(knitr)
library(ggplot2)
library(shinythemes)
library(rsconnect)
########################################################################################################
# update cran mirror
local({
r <- getOption("repos");
r["CRAN"] <- "https://cran.rstudio.com/"
options(repos=r)
})
# Reference: https://support.rstudio.com/hc/en-us/articles/206827897-Secure-Package-Downloads-for-R
########################################################################################################
# initial Rmd example
# initRmdExample <-
# paste(c('This is an example taken from the **knitr** package. Press `F4` or `Ctrl+Shift+H` to compile it, and `Ctrl+Alt+I` to insert a code chunk.', '',
# readLines(system.file('examples', 'knitr-minimal.Rmd', package = 'knitr'))), collapse = '\n')
# initRmdExample <-
# paste(c('This is an example taken from the **knitr** package. Press `F4` or `Ctrl+Shift+H` to compile it, and `Ctrl+Alt+I` to insert a code chunk.', '',
# readLines(file.path("R","knitExample_Allfeatures.Rmd"))), collapse = '\n')
# initRmdExample <- readLines(file.path("R","knitExample_Allfeatures.Rmd"))
initRmdExample <- readLines(file.path("R","knitExample_Basic.Rmd"))
# filePath <- file.path("R","knitExample_Basic.Rmd")
# fileChars <- readChar(filePath, nchars = file.info(filePath)$size)
CustomJS <- list()
# show/hide R functions
CustomJS$show <- function(id = NULL, class = NULL, display = 'inherit', session = shiny::getDefaultReactiveDomain()){
if(!is.null(id)) session$sendCustomMessage(type = 'element_display_id', message = list(id = id, display = display))
}
CustomJS$hide <- function(id = NULL, class = NULL, session = shiny::getDefaultReactiveDomain()){
if(!is.null(id)) session$sendCustomMessage(type = 'element_display_id', message = list(id = id, display = 'none'))
}
########################################################################################################
## Refernce Links
# https://ace.c9.io/#nav=embedding
# https://rstudio.github.io/shinythemes/
########################################################################################################