Skip to content

Commit

Permalink
Replace 'library()' with 'require()' which is (about 5 times) faster
Browse files Browse the repository at this point in the history
  • Loading branch information
aursiber committed Oct 1, 2024
1 parent 3f57969 commit 3a52d51
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ remotes::install_github("lbbe-software/DRomics")

Finally load the package in your current R session with the following R command:
```r
library(DRomics)
require("DRomics")
```


Expand Down
18 changes: 9 additions & 9 deletions inst/DRomics-shiny/global.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
library(shiny, quietly = TRUE)
library(DRomics, quietly = TRUE)
library(ggplot2, quietly = TRUE)
library(shinyjs, quietly = TRUE)
library(shinyBS, quietly = TRUE)
library(shinycssloaders, quietly = TRUE)
library(tools, quietly = TRUE)
library(svglite, quietly = TRUE)
require("shiny", quietly = TRUE)
require("DRomics", quietly = TRUE)
require("ggplot2", quietly = TRUE)
require("shinyjs", quietly = TRUE)
require("shinyBS", quietly = TRUE)
require("shinycssloaders", quietly = TRUE)
require("tools", quietly = TRUE)
require("svglite", quietly = TRUE)
addResourcePath('DRomicspkg', system.file("extdata", package="DRomics"))
options(shiny.maxRequestSize=30*1024^2)

text_bgdose <- "The value of doses under which doses can be replaced by 0, to be considered as the background dose for BMD calculation, is necessary only if there is no dose at zero in the data. To prevent hazardous calculation of BMDs by extrapolation, DRomics will not run without null doses in the design or specification of this background dose."
text_bgdose <- "The value of doses under which doses can be replaced by 0, to be considered as the background dose for BMD calculation, is necessary only if there is no dose at zero in the data. To prevent hazardous calculation of BMDs by extrapolation, DRomics will not run without null doses in the design or specification of this background dose."
2 changes: 1 addition & 1 deletion inst/DRomics-shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ server <- function(input, output, session) {
req(input$datafile_anchoring)
}

text <- c("library(DRomics)",
text <- c("require('DRomics')",
"",
"# Step 1",
paste0("o <- ", ifelse(input$typeData == 'microarraydata',
Expand Down
16 changes: 8 additions & 8 deletions inst/DRomicsInterpreter-shiny/global.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
library(shiny, quietly = TRUE)
library(shinyjs, quietly = TRUE)
library(shinyBS, quietly = TRUE)
library(shinyWidgets, quietly = TRUE)
library(DRomics, quietly = TRUE)
library(sortable, quietly = TRUE)
library(ggplot2, quietly = TRUE)
library(plotly, quietly = TRUE)
require("shiny", quietly = TRUE)
require("shinyjs", quietly = TRUE)
require("shinyBS", quietly = TRUE)
require("shinyWidgets", quietly = TRUE)
require("DRomics", quietly = TRUE)
require("sortable", quietly = TRUE)
require("ggplot2", quietly = TRUE)
require("plotly", quietly = TRUE)
addResourcePath('DRomicspkg', system.file("extdata", package="DRomics"))
options(shiny.maxRequestSize=30*1024^2)

Expand Down
2 changes: 1 addition & 1 deletion inst/DRomicsInterpreter-shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ server <- function(input, output, session) {
req(input$annotationData1)

##### STEP 1 #####
text <- c("library(DRomics)",
text <- c("require('DRomics')",
"",
"# Step 1",
"extendedres <- list()",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
library("testthat")
library("DRomics")
require("testthat")
require("DRomics")
test_check("DRomics")

0 comments on commit 3a52d51

Please sign in to comment.