File: global.R

package info (click to toggle)
r-cran-rlumshiny 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,332 kB
  • sloc: javascript: 922; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (3)
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
## +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Title:   Filter_app
## Authors: Urs Tilmann Wolpert, Department of Geography, Justus-Liebig-University Giessen
##          Sebastian Kreutzer, IRAMAT-CRP2A, Universite Bordeaux Montaigne (France)
## Contact: urs.t.wolpert@geogr.uni-giessen.de
## Date:    Thu June 22 2017
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
library(shiny)
library(Luminescence)
library(readxl)
library(RLumShiny)

##check whether a real database exists or the template should be loaded
if(dir.exists("Data")){
  ##set to first file
  database_path <- list.files("Data/", full.names = TRUE)[1]

  ##check whether this is a real XLSX file
  if(rev(strsplit(database_path, split = ".", fixed = TRUE)[[1]])[1] != "xlsx"){
    stop("The filter database file needs to be of type 'xlsx'!")

  }

}else{
  database_path <- "template/template.xlsx"

}

# ##load data and cleanup filter list
filters <- readxl::excel_sheets(database_path)
filters <- filters[!grepl(pattern = "Main List", x = filters, fixed = TRUE)]