-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobal.R
36 lines (26 loc) · 1004 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
# Packages ----------------------------------------------------------------
library(shiny)
library(drc)
library(ggplot2)
library(shinyjs)
library(esmisc)
library(plotly)
# drc models --------------------------------------------------------------
mods <- getMeanFunctions(display = FALSE)
select_mod <- sapply(mods, '[', 1)
names(select_mod) <- paste0(sapply(mods, '[', 1),
': ',
sapply(mods, '[', 2))
# parse textInput ---------------------------------------------------------
numextractall <- function(string) {
# http://stackoverflow.com/questions/19252663/extracting-decimal-numbers-from-a-string
as.numeric(unlist(regmatches(string, gregexpr("[[:digit:]]+\\.*[[:digit:]]*", string)),
use.names = FALSE))
}
# Calc x-breaks -----------------------------------------------------------
x <- 11:1001
xmin <- min(x)
xmax <- max(x)
get_breaks <- function(x) {
10^(seq(floor(log10(xmin)), floor(log10(xmax))))
}