Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #26 from HendrikSchultheis/cran_request
testthat package
  • Loading branch information
HendrikSchultheis committed Jul 16, 2018
2 parents 1b98804 + d389b4c commit 4cd6195
Show file tree
Hide file tree
Showing 24 changed files with 41,408 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .buildkite/pipeline.yml
Expand Up @@ -5,7 +5,8 @@ steps:
- ". /etc/profile.d/conda.sh"
- "conda activate wilson"
# - "Rscript -e 'install.packages(\"rje\")'"
- "Rscript -e 'devtools::check()'"
- "R CMD build ."
- "R CMD check *tar.gz --as-cran"

# - wait

Expand Down
5 changes: 4 additions & 1 deletion .buildkite/wilson-env.yml
Expand Up @@ -16,7 +16,7 @@ dependencies:
- r-RColorBrewer
- r-shinyjs
- r-viridis
# - r-rje
- r-rje
# - r-grdevices # base package
# - r-grid # base package
- r-plyr
Expand All @@ -43,3 +43,6 @@ dependencies:
- r-devtools
- "readline==6.3"
- r-roxygen2
- r-rmarkdown
- r-testthat
# - r-vdiffr # not yet in conda-forge
5 changes: 3 additions & 2 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: wilson
Type: Package
Title: Web-Based Interactive Omics Visualization
Version: 2.0.0
Version: 2.0.1
Authors@R: c(
person("Hendrik", "Schultheis", email = "hendrik.schultheis@mpi-bn.mpg.de", role = c("aut", "cre")),
person("Jens", "Preussner", email = "jens.preussner@mpi-bn.mpg.de", role = "aut"),
Expand Down Expand Up @@ -50,5 +50,6 @@ RoxygenNote: 6.0.1
biocViews:
Suggests: knitr,
rmarkdown,
testthat
testthat,
vdiffr
VignetteBuilder: knitr
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,3 +1,5 @@
# wilson 2.0.1
- tests added
# wilson 2.0.0
## Features
- clarion class:
Expand Down
30 changes: 17 additions & 13 deletions R/function.R
Expand Up @@ -125,7 +125,7 @@ create_scatterplot <- function(data, data.labels = NULL, data.hovertext = NULL,
if (density) {
### kernel density
# plot$layers <- c(stat_density2d(geom = "tile", aes(fill = ..density..^0.25), n=200, contour=FALSE) + aes_(fill = as.name(var)), plot$layers) # n = resolution; density less sparse
plot <- plot + ggplot2::stat_density2d(geom = "tile", ggplot2::aes_(fill = ~ ..density.. ^ 0.25), n = 200, contour = FALSE)
plot <- plot + ggplot2::stat_density2d(geom = "tile", ggplot2::aes_(fill = ~ ..density.. ^ 0.25, color = NULL), n = 200, contour = FALSE)

plot <- plot + ggplot2::scale_fill_gradient(low = "white", high = "black") +
# guides(fill=FALSE) + # remove density legend
Expand Down Expand Up @@ -1152,7 +1152,7 @@ searchData <- function(input, choices, options = c("=", "<", ">"), min. = min(ch
}

# range
if ("inner" == options){
if ("inner" == options) {
if (x >= input[1] & x <= input[2]) return(TRUE)
}
if ("outer" == options) {
Expand Down Expand Up @@ -1203,15 +1203,17 @@ searchData <- function(input, choices, options = c("=", "<", ">"), min. = min(ch
download <- function(file, filename, plot, width, height, ppi = 72, save_plot = TRUE, ui = NULL) {
session <- shiny::getDefaultReactiveDomain()

# show notification
shiny::showNotification(
id = session$ns("download-note"),
shiny::tags$b("Preparing download files. Please wait..."),
duration = NULL,
closeButton = FALSE,
type = "message"
)
shinyjs::runjs(paste0("$(document.getElementById('", paste0("shiny-notification-", session$ns("download-note")), "')).addClass('notification-position-center');"))
if (!is.null(session)) {
# show notification
shiny::showNotification(
id = session$ns("download-note"),
shiny::tags$b("Preparing download files. Please wait..."),
duration = NULL,
closeButton = FALSE,
type = "message"
)
shinyjs::runjs(paste0("$(document.getElementById('", paste0("shiny-notification-", session$ns("download-note")), "')).addClass('notification-position-center');"))
}

# cut off file extension
name <- sub("(.*)\\..*$", replacement = "\\1", filename)
Expand Down Expand Up @@ -1283,8 +1285,10 @@ download <- function(file, filename, plot, width, height, ppi = 72, save_plot =
# remove tmp files
file.remove(files)

# remove notification
shiny::removeNotification(session$ns("download-note"))
if (!is.null(session)) {
# remove notification
shiny::removeNotification(session$ns("download-note"))
}

return(out)
}
Expand Down
4 changes: 3 additions & 1 deletion R/global.R
Expand Up @@ -11,8 +11,10 @@ wilson.globals <- new.env(parent = emptyenv())
#'
#' @export
set_logger <- function(logger, token = NULL) {
if (is.null(logger) || methods::is(logger, "logger")) {
if (methods::is(logger, "logger")) {
assign(x = paste0("logger", token), value = logger, envir = wilson.globals)
} else if (is.null(logger)) {
rm(list = paste0("logger", token), envir = wilson.globals)
}
}

Expand Down
35 changes: 35 additions & 0 deletions cran-comments.md
@@ -1,3 +1,4 @@
# Submission 1
## Test environments
* local windows 7 install, R 3.5.1
* debian 9.4, R 3.4.1
Expand All @@ -20,3 +21,37 @@ There was 1 NOTE:
I have also run R CMD check on downstream dependencies of wilson
(https://github.molgen.mpg.de/loosolab/wilson/tree/master/revdep).
All packages that I could install passed.

## Reviewer comments
Thanks, we see you have lots of cuntions without examples (which may be reasonable given they are not intended t be called by users directly).
Nevertheless, it would be good to have them tested, so please create, if examples are not feasible, at least tests that execute the various functions in your package.

Best,
Uwe Ligges

# Submission 2
## Test environments
* local windows 7 install, R 3.5.1
* debian 9.4, R 3.4.1
* win-builder (devel and release)

## Submission comments
Addressed reviewer comments by adding tests where possible.

## R CMD check results
There were no ERRORs or WARNINGs.

There was 1 NOTE:

* New submission

* Possibly mis-spelled words in DESCRIPTION:
Omics (3:30)
omics (9:126)

Both are spelled correctly. First is capital because of title case.

## Downstream dependencies
I have also run R CMD check on downstream dependencies of wilson
(https://github.molgen.mpg.de/loosolab/wilson/tree/master/revdep).
All packages that I could install passed.
10 changes: 6 additions & 4 deletions revdep/README.md
Expand Up @@ -10,7 +10,7 @@
|language |(EN) |
|collate |German_Germany.1252 |
|tz |Europe/Berlin |
|date |2018-07-04 |
|date |2018-07-16 |

## Packages

Expand All @@ -24,10 +24,10 @@
|DT | |0.4 |2018-01-30 |CRAN (R 3.5.1) |
|factoextra | |1.0.5 |2017-08-22 |CRAN (R 3.5.1) |
|FactoMineR | |1.41 |2018-05-04 |CRAN (R 3.5.1) |
|ggplot2 | |2.2.1 |2016-12-30 |CRAN (R 3.5.1) |
|ggplot2 | |3.0.0 |2018-07-03 |CRAN (R 3.5.1) |
|ggrepel | |0.8.0 |2018-05-09 |CRAN (R 3.5.1) |
|gplots | |3.0.1 |2016-03-30 |CRAN (R 3.5.1) |
|heatmaply | |0.15.0 |2018-06-23 |CRAN (R 3.5.1) |
|heatmaply | |0.15.2 |2018-07-06 |CRAN (R 3.5.1) |
|knitr | |1.20 |2018-02-20 |CRAN (R 3.5.1) |
|log4r | |0.2 |2014-09-29 |CRAN (R 3.5.1) |
|openssl | |1.0.1 |2018-03-03 |CRAN (R 3.5.1) |
Expand All @@ -46,8 +46,10 @@
|shinycssloaders | |0.2.0 |2017-05-12 |CRAN (R 3.5.1) |
|shinydashboard | |0.7.0 |2018-03-21 |CRAN (R 3.5.1) |
|shinyjs | |1.0 |2018-01-08 |CRAN (R 3.5.1) |
|testthat | |2.0.0 |2017-12-13 |CRAN (R 3.5.1) |
|vdiffr | |0.2.3 |2018-04-27 |CRAN (R 3.5.1) |
|viridis | |0.5.1 |2018-03-29 |CRAN (R 3.5.1) |
|wilson |* |2.0.0 |2018-07-04 |local (HendrikSchultheis/wilson@NA) |
|wilson | |2.0.1 |2018-07-16 |local (HendrikSchultheis/wilson@NA) |

# Check results

Expand Down
Binary file modified revdep/checks.rds
Binary file not shown.
10 changes: 6 additions & 4 deletions revdep/problems.md
Expand Up @@ -10,7 +10,7 @@
|language |(EN) |
|collate |German_Germany.1252 |
|tz |Europe/Berlin |
|date |2018-07-04 |
|date |2018-07-16 |

## Packages

Expand All @@ -24,10 +24,10 @@
|DT | |0.4 |2018-01-30 |CRAN (R 3.5.1) |
|factoextra | |1.0.5 |2017-08-22 |CRAN (R 3.5.1) |
|FactoMineR | |1.41 |2018-05-04 |CRAN (R 3.5.1) |
|ggplot2 | |2.2.1 |2016-12-30 |CRAN (R 3.5.1) |
|ggplot2 | |3.0.0 |2018-07-03 |CRAN (R 3.5.1) |
|ggrepel | |0.8.0 |2018-05-09 |CRAN (R 3.5.1) |
|gplots | |3.0.1 |2016-03-30 |CRAN (R 3.5.1) |
|heatmaply | |0.15.0 |2018-06-23 |CRAN (R 3.5.1) |
|heatmaply | |0.15.2 |2018-07-06 |CRAN (R 3.5.1) |
|knitr | |1.20 |2018-02-20 |CRAN (R 3.5.1) |
|log4r | |0.2 |2014-09-29 |CRAN (R 3.5.1) |
|openssl | |1.0.1 |2018-03-03 |CRAN (R 3.5.1) |
Expand All @@ -46,8 +46,10 @@
|shinycssloaders | |0.2.0 |2017-05-12 |CRAN (R 3.5.1) |
|shinydashboard | |0.7.0 |2018-03-21 |CRAN (R 3.5.1) |
|shinyjs | |1.0 |2018-01-08 |CRAN (R 3.5.1) |
|testthat | |2.0.0 |2017-12-13 |CRAN (R 3.5.1) |
|vdiffr | |0.2.3 |2018-04-27 |CRAN (R 3.5.1) |
|viridis | |0.5.1 |2018-03-29 |CRAN (R 3.5.1) |
|wilson |* |2.0.0 |2018-07-04 |local (HendrikSchultheis/wilson@NA) |
|wilson | |2.0.1 |2018-07-16 |local (HendrikSchultheis/wilson@NA) |

# Check results

Expand Down

0 comments on commit 4cd6195

Please sign in to comment.