Skip to content

Commit

Permalink
Fix DESCRIPTION, conform style, and improve consistency in logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsimenc committed Jul 13, 2024
1 parent d5457bb commit fdca505
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Authors@R: c(
person("Alan", "O'Callaghan", comment = "https://github.com/Alanocallaghan",role = "aut"),
person("Jonathan", "Sidi", email = "[email protected]", comment = "https://github.com/yonicd",role = "ctb"),
person("Jaehyun", "Joo", comment = "https://github.com/jaehyunjoo",role = "ctb"),
person("Yoav", "Benjamini", email = "[email protected]",role = "ths"))
person("Yoav", "Benjamini", email = "[email protected]",role = "ths")),
person("Mathew", "Simenc", role = "ctb", comment = "https://gitlab.com/mcsimenc, https://github.com/mcsimenc"))
Description: Create interactive cluster 'heatmaps' that can be saved as a stand-
alone HTML file, embedded in 'R Markdown' documents or in a 'Shiny' app, and
Expand Down
12 changes: 6 additions & 6 deletions R/heatmaply.R
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@
#'
#'
#' # Example of removing labels and thus making the plot faster
#' heatmaply(iris, showticklabels = c(T, F), margins = c(80, 10))
#' heatmaply(iris, showticklabels = c(TRUE, FALSE), margins = c(80, 10))
#'
#' # this is what allows for a much larger matrix to be printed:
#' set.seed(2017 - 05 - 18)
#' large_x <- matrix(rnorm(19), 1000, 100)
#' heatmaply(large_x, dendrogram = F, showticklabels = F, margins = c(1, 1))
#' heatmaply(large_x, dendrogram = FALSE, showticklabels = FALSE, margins = c(1, 1))
#' }
heatmaply <- function(x, ...) {
UseMethod("heatmaply")
Expand Down Expand Up @@ -571,7 +571,7 @@ heatmaply.default <- function(x,
label_format_fun = function(...) format(..., digits = 4),
labRow = NULL, labCol = NULL,
custom_hovertext = NULL,
suppress_default_hovertext = F,
suppress_default_hovertext = FALSE,
col = NULL,
dend_hoverinfo = TRUE,
side_color_colorbar_len = 0.3,
Expand Down Expand Up @@ -643,8 +643,8 @@ heatmaply.default <- function(x,
if (is.logical(dendrogram)) {
# Using if and not ifelse to make sure the output is a "scalar".
dendrogram <- if (dendrogram) "both" else "none"
# if (T) "both" else "none"
# if (F) "both" else "none"
# if (TRUE) "both" else "none"
# if (FALSE) "both" else "none"
}
dendrogram <- match.arg(dendrogram)

Expand Down Expand Up @@ -1213,7 +1213,7 @@ heatmaply.heatmapr <- function(x,
title = main, # layout's title: /r/reference/#layout-title
xaxis = list( # layout's xaxis is a named list. List of valid keys: /r/reference/#layout-xaxis
title = xlab # xaxis's title: /r/reference/#layout-xaxis-title
# showgrid = T # xaxis's showgrid: /r/reference/#layout-xaxis-showgrid
# showgrid = TRUE # xaxis's showgrid: /r/reference/#layout-xaxis-showgrid
),
yaxis = list( # layout's yaxis is a named list. List of valid keys: /r/reference/#layout-yaxis
title = ylab # yaxis's title: /r/reference/#layout-yaxis-title
Expand Down
6 changes: 3 additions & 3 deletions R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ ggplot_heatmap <- function(xx,
}
}
if (!is.null(custom_hovertext)) {
if (suppress_default_hovertext) {
mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]]
} else {
if (!suppress_default_hovertext) {
mdf[["text"]] <- paste0(mdf[["text"]], "<br>", custom_hovertext)
} else {
mdf[["text"]] <- reshape2::melt(as.matrix(custom_hovertext))[[3]]
}
}
geom_args[["mapping"]] <- aes_mapping
Expand Down
4 changes: 2 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ heatmaplyWelcomeMessage <- function() {
# # http://stackoverflow.com/questions/10330425/how-do-i-export-a-git-log-to-a-text-file
# # http://stackoverflow.com/questions/3523534/good-ways-to-manage-a-changelog-using-git
# # http://www.commandlinefu.com/commands/view/12420/generate-a-change-log-with-git
# shell("git log --decorate > ChangeLog", intern = T)
# shell("git log --decorate > ChangeLog", intern = TRUE)

# Modify it using: http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History
# http://stackoverflow.com/questions/9007181/custom-log-format-omits-newline-at-end-of-output
Expand Down Expand Up @@ -305,6 +305,6 @@ heatmaplyWelcomeMessage <- function() {
# file.copy("NEWS", "NEWS.md",overwrite = TRUE)
# devtools::check_win_devel()
# pkgdown::build_home()
# pkgdown::build_site(run_dont_run = F)
# pkgdown::build_site(run_dont_run = FALSE)
# pkgdown::build_news()
# release()

0 comments on commit fdca505

Please sign in to comment.