Skip to content

Commit

Permalink
new release
Browse files Browse the repository at this point in the history
  • Loading branch information
vertesy committed Oct 24, 2024
1 parent f2b56a0 commit 41434ad
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 114 deletions.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cff-version: 1.2.0
title: vertesy/MarkdownReports v4.3.2 Type Less, Plot More. Create (scientific) plots with very little code and write (markdown) reports easily from your R scripts.
version: v4.7.1
version: v4.8.0
message: >-
If you use this software, please cite it using these metadata.
type: software
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MarkdownReports
Title: Generate Scientific Figures and Reports Easily
Version: 4.7.1
Version: 4.8.0
Authors@R:
person("Abel", "Vertesy", , "[email protected]", role = c("aut", "cre"))
Author: Abel Vertesy <[email protected]> [aut, cre]
Expand Down Expand Up @@ -34,6 +34,6 @@ Imports:
VennDiagram,
vioplot
Encoding: UTF-8
Packaged: 2024-05-03 19:06:48.366226
Packaged: 2024-10-24 16:00:45.369786
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
4 changes: 3 additions & 1 deletion Development/config.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Configuration for the Package
# file.edit("~/GitHub/Packages/XXXXXXXXXX/Development/config.R")

DESCRIPTION <- list(
package.name = "MarkdownReports",
version = "4.7.1",
version = "4.8.0",
title = "Generate Scientific Figures and Reports Easily",
description = "MarkdownReports is a set of R functions that allows you to generate precise figures easily,
and create clean markdown reports about what you just discovered with your analysis script. It helps you to:
Expand Down
37 changes: 22 additions & 15 deletions R/MarkdownReports.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,16 @@ create_set_SubDir <- function(..., define.ParentDir = TRUE,
}
if (define.ParentDir) {
if (exists("ParentDir")) { # If this function has been run already, you have "ParentDir", which will be overwritten.
if (verbose) { print("ParentDir was defined as:"); message(ParentDir) }
if (verbose) {
print("ParentDir was defined as:")
message(ParentDir)
}
} # if

if (verbose) { print("ParentDir will be:"); message(OutDir) }
if (verbose) {
print("ParentDir will be:")
message(OutDir)
}
MarkdownHelpers::ww.assign_to_global("ParentDir", OutDir, 1)
} # if
if (verbose) print("Call *create_set_Original_OutDir()* when chaning back to the main dir.")
Expand Down Expand Up @@ -334,9 +340,6 @@ continue_logging_markdown <- function(b.scriptname) {
#' specified directory (OutDir). If they do not match, it prints both directories to the
#' screen.
#'
#' @param OutDir The target directory to compare with the current working directory.
#' Default: OutDir (assumes that OutDir should be defined in the global environment).
#'
#' @return Prints a message to the console if the current working directory does not
#' match OutDir. No return value.
#'
Expand All @@ -346,8 +349,8 @@ continue_logging_markdown <- function(b.scriptname) {
#' @importFrom checkmate assertCharacter
#' @export
check_OutDir <- function() {
# Get the current working directory
current_dir <- paste0(getwd(),"/")
# Get the current working directory
current_dir <- paste0(getwd(), "/")

# Check if OutDir is defined and if current_dir is not equal to OutDir
if (!exists("OutDir")) {
Expand Down Expand Up @@ -445,18 +448,19 @@ wplot_save_pheatmap <- function(x,
suffix = "heatmap",
plotname = as.character(substitute(x)),
add = 1,
width = max(if(is.null(data)) 7 else ncol(data) + add, 4),
height = max(if(is.null(data)) 7 else nrow(data) - add, 4),
width = max(if (is.null(data)) 7 else ncol(data) + add, 4),
height = max(if (is.null(data)) 7 else nrow(data) - add, 4),
pdf = TRUE,
png = FALSE,
png_res = 100, # NA
png_dim_factor = 100,
mdlink = TRUE) {
#
stopifnot(inherits(x, "pheatmap"),
is.character(suffix), is.character(plotname), nchar(plotname) < 200,
is.numeric(add), is.numeric(width), is.numeric(height),
is.logical(pdf), is.logical(png), is.numeric(png_res), is.numeric(png_dim_factor), is.logical(mdlink)
stopifnot(
inherits(x, "pheatmap"),
is.character(suffix), is.character(plotname), nchar(plotname) < 200,
is.numeric(add), is.numeric(width), is.numeric(height),
is.logical(pdf), is.logical(png), is.numeric(png_res), is.numeric(png_dim_factor), is.logical(mdlink)
)

message("width: ", width, "; height: ", height, "\nplotname: ", plotname, "; suffix: ", suffix)
Expand Down Expand Up @@ -1094,13 +1098,16 @@ wbarplot <- function(variable,
#' @param mdlink Insert a .pdf and a .png image link in the markdown report, set by
#' "path_of_report".
#' @param PNG Set to true if you want to save the plot as PNG instead of the default PDF.
#' @export
#' @examples MyGauss <- rnorm(1000)
#'
#' @examples
#' MyGauss <- rnorm(1000)
#' whist(
#' variable = MyGauss, col = "gold1", w = 7,
#' breaks = 20, mdlink = FALSE, hline = FALSE, vline = FALSE, lty = 2, lwd = 3,
#' lcol = 2, filtercol = 0
#' )
#'
#' @export
whist <- function(variable,
...,
breaks = 20,
Expand Down
Loading

0 comments on commit 41434ad

Please sign in to comment.