-
Notifications
You must be signed in to change notification settings - Fork 1
/
global.R
35 lines (31 loc) · 888 Bytes
/
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
#
# LOADING LIBRARIES
# ***********************************************
library(shiny)
library(lattice)
library(latticeExtra)
library(latticetools)
library(tidyr)
library(dplyr)
library(ggplot2)
library(shinyTree)
library(shinythemes)
library(dendextend)
library(directlabels)
library(configr)
# LOADING EXTERNAL FUNCTIONS AND DATA
# ***********************************************
for (Rfile in list.files("R", full.names = TRUE)) {
source(Rfile)
}
# list of data files
data_list <- list.files("data", pattern = "\\.Rdata$", full.names = TRUE)
# load all of them
for (path in data_list) load(path)
# clean names for selectInput
data_list <- gsub("^data/|.Rdata$", "", data_list)
# load corresponding YAML configuration file
data_config <- lapply(data_list, function(dat) {
configr::read.config(paste0("data/", dat, ".yml")) %>%
suppressWarnings()
}) %>% setNames(data_list)