diff --git a/inst/ShinyApps/labestDataView/global.R b/inst/ShinyApps/labestDataView/global.R deleted file mode 100644 index 280e94a84d65bcb4a0def3765997c487ed5a374c..0000000000000000000000000000000000000000 --- a/inst/ShinyApps/labestDataView/global.R +++ /dev/null @@ -1,31 +0,0 @@ -##------------------------------------------- -## global.R - -library(xtable) -library(labestData) - -data(keywords, package = "labestData") -keywords$obra <- gsub( - pattern = "^([A-Z]{1}[a-z]*)[A-Z]{1}[a-z]{1}.*$", - replacement = "\\1", - x = keywords$name) - -howmanydigits <- function(x) { - x <- na.omit(x) - if (is.numeric(x) && all(x%%1 == 0)) { - 0 - } else if (is.numeric(x)) { - 1 + floor(log10(1/min(diff(sort(unique(x)))))) - } else { - 0 - } -} - -static_help <- function(pkg, topic, out, - links = tools::findHTMLlinks()) { - pkgRdDB = tools:::fetchRdDB(file.path( - find.package(pkg), 'help', pkg)) - force(links) - tools::Rd2HTML(pkgRdDB[[topic]], out, package = pkg, - Links = links, no_links = is.null(links)) -} diff --git a/inst/ShinyApps/labestDataView/server.R b/inst/ShinyApps/labestDataView/server.R index c98ec179a7d4af7d1b40c890be7bd09007a6f35d..e91dbf345484020015406944fd56368d4aa1fdec 100644 --- a/inst/ShinyApps/labestDataView/server.R +++ b/inst/ShinyApps/labestDataView/server.R @@ -1,3 +1,35 @@ +##------------------------------------------- +## Variables and functions + +library(xtable) +library(labestData) + +## data(keywords, package = "labestData") +keywords$obra <- gsub( + pattern = "^([A-Z]{1}[a-z]*)[A-Z]{1}[a-z]{1}.*$", + replacement = "\\1", + x = keywords$name) + +howmanydigits <- function(x) { + x <- na.omit(x) + if (is.numeric(x) && all(x%%1 == 0)) { + 0 + } else if (is.numeric(x)) { + 1 + floor(log10(1/min(diff(sort(unique(x)))))) + } else { + 0 + } +} + +static_help <- function(pkg, topic, out, + links = tools::findHTMLlinks()) { + pkgRdDB = tools:::fetchRdDB(file.path( + find.package(pkg), 'help', pkg)) + force(links) + tools::Rd2HTML(pkgRdDB[[topic]], out, package = pkg, + Links = links, no_links = is.null(links)) +} + ##------------------------------------------- ## server.R