diff --git a/.gitignore b/.gitignore index 9cd12d8..5460e43 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,5 @@ vignettes/*.pdf *.knit.md # R Environment Variables -.Renviron \ No newline at end of file +.Renviron +.Rproj.user diff --git a/DESCRIPTION b/DESCRIPTION index 4b4bcb6..bb986cd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: MarkdownReports Title: Generate Scientific Figures and Reports Easily -Version: 4.1.1.3 +Version: 4.1.0 Authors@R: person(given = "Abel", family = "Vertesy", @@ -36,6 +36,7 @@ Imports: vioplot Encoding: UTF-8 LazyData: true -Packaged: 2019-11-27 16:25:54 +Packaged: 2020-12-16 11:20:44 Repository: CRAN -RoxygenNote: 7.0.0 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.1.1 diff --git a/Development/Development.bac b/Development/Development.bac index 66c77f2..6caad91 100644 --- a/Development/Development.bac +++ b/Development/Development.bac @@ -37,7 +37,7 @@ utils::globalVariables(c('OutDirOrig', 'OutDir', 'ParentDir', 'path_of_report', #' @param OutDir The output directory (absolute / full path). #' @param title Manually set the title of the report. #' @param append Set append to TRUE if you do not want to overwrite the previous report. -#' @param backupfolder Create a time-stamped backup folder inside the working directory (OutDir). +#' @param backupfolder Create a time-stamped backup folder inside the working directory (OutDir)? #' @param recursive.folder Create output folder recursively, if parent folders do not exist. Parameter for dir.create(). #' Use continue_logging_markdown() if you return logging into an existing report. #' FALSE by default: rerunning the script overwrites the previous report. Archive reports manually @@ -73,7 +73,7 @@ utils::globalVariables(c('OutDirOrig', 'OutDir', 'ParentDir', 'path_of_report', #' append = TRUE, b.png4Github = TRUE) setup_MarkdownReports <- - function(OutDir = getwd(), + function (OutDir = getwd(), scriptname = basename(OutDir), title = "", setDir = TRUE, @@ -101,8 +101,8 @@ setup_MarkdownReports <- if (!exists(OutDir)) { dir.create(OutDir, showWarnings = FALSE, recursive = recursive.folder) } - OutDir = AddTrailingSlash(OutDir) # add '/' if necessary - OutDir = RemoveDoubleSlash(OutDir) + if (!substrRight(OutDir, 1) == "/") + OutDir = paste0(OutDir, "/") # add '/' if necessary ww.assign_to_global("OutDir", OutDir, 1) iprint("All files will be saved under 'OutDir': ", OutDir) @@ -147,7 +147,7 @@ setup_MarkdownReports <- capture.output( sessioninfo::session_info() ),con = paste0(".sessionInfo.", format(Sys.time(), format ="%Y.%m.%d" ),".txt") - ) + ) options("width"= defWidth) rm(defWidth) @@ -173,7 +173,7 @@ setup_MarkdownReports <- ww.assign_to_global("b.scriptname", scriptname, 1) ww.assign_to_global("b.def.color", b.def.color, 1) ww.assign_to_global("b.report.not.found", - "Path to the Markdown report file is not defined in path_of_report", 1) + "Path to the Markdown report file is not defined in path_of_report", 1) } # create_set_SubDir @@ -190,16 +190,18 @@ setup_MarkdownReports <- #' @examples create_set_SubDir (makeOutDirOrig = TRUE, setDir = TRUE, "MySubFolder") create_set_SubDir <- - function(..., define.ParentDir = TRUE, + function (..., define.ParentDir = TRUE, setDir = TRUE, verbose = TRUE) { b.Subdirname = kollapse(...) OutDir = ww.set.OutDir() NewOutDir = kollapse(OutDir, ..., print = FALSE) - - NewOutDir = AddTrailingSlash(NewOutDir) # add '/' if necessary - NewOutDir = RemoveDoubleSlash(NewOutDir) + if (!substrRight(NewOutDir, 1) == "/") + NewOutDir = paste0(NewOutDir, "/") # add '/' if necessary + NewOutDir = gsub(x = NewOutDir, + pattern = '//', + replacement = '/') # replace // if (verbose) iprint("All files will be saved under 'NewOutDir': ", NewOutDir) if (!dir.exists(NewOutDir)) { dir.create(NewOutDir, showWarnings = FALSE) @@ -233,7 +235,7 @@ create_set_SubDir <- #' @examples create_set_Original_OutDir (getwd(),"/") create_set_Original_OutDir <- - function(NewOutDir = OutDirOrig, + function (NewOutDir = OutDirOrig, b.Subdirname = FALSE, setDir = TRUE, verbose = TRUE) { @@ -257,7 +259,7 @@ create_set_Original_OutDir <- #' @examples OutDir = paste0(getwd(),"/", collapse = "") #' continue_logging_markdown (b.scriptname = "Analysis") -continue_logging_markdown <- function(b.scriptname) { +continue_logging_markdown <- function (b.scriptname) { path = ww.set.OutDir() path_of_report <- kollapse(path, b.scriptname, ".log.md", print = FALSE) @@ -287,10 +289,13 @@ continue_logging_markdown <- function(b.scriptname) { #' @export #' @examples create_set_OutDir (setDir = TRUE, getwd(),"/" ) -create_set_OutDir <- function(..., setDir = TRUE, verbose = TRUE) { +create_set_OutDir <- function (..., setDir = TRUE, verbose = TRUE) { OutDir = kollapse(..., print = FALSE) - OutDir = AddTrailingSlash(OutDir) # add '/' if necessary - OutDir = RemoveDoubleSlash(OutDir) + if (!substrRight(OutDir, 1) == "/") + OutDir = paste0(OutDir, "/") # add '/' if necessary + OutDir = gsub(x = OutDir, + pattern = '//', + replacement = '/') if (verbose) iprint("All files will be saved under 'OutDir': ", OutDir) if (!exists(OutDir)) { dir.create(OutDir, showWarnings = FALSE) @@ -313,7 +318,7 @@ create_set_OutDir <- function(..., setDir = TRUE, verbose = TRUE) { #' @param plotname Title of the plot (main parameter) and also the name of the file. #' @param OverwritePrevPDF Overwrite previous PDF image (as name stored in plotnameLastPlot). #' If FALSE, it creates a name from the date. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param w Width of the saved pdf image, in inches. #' @param h Height of the saved pdf image, in inches. @@ -325,7 +330,7 @@ create_set_OutDir <- function(..., setDir = TRUE, verbose = TRUE) { #' , mdlink = FALSE, ManualName = FALSE) wplot_save_this <- - function(plotname = ww.autoPlotName(), + function (plotname = ww.autoPlotName(), ..., OverwritePrevPDF = TRUE, w = unless.specified("b.defSize", 7), @@ -347,39 +352,6 @@ wplot_save_this <- } -#' wplot_save_pheatmap -#' -#' Save pheatmap object. Modified from: -#' https://stackoverflow.com/questions/43051525/how-to-draw-pheatmap-plot-to-screen-and-also-save-to-file -#' @param x The pheatmap object to save. -#' @param filename File name (saved as .pdf, inside working directory). -#' @param width width of the plot in inches. -#' @param height height of the plot in inches. -#' @export -#' -#' @examples test = matrix(rnorm(200), 20, 10); -#' colnames(test) = paste("Test", 1:10, sep = ""); -#' rownames(test) = paste("Gene", 1:20, sep = ""); -#' ph.test <- pheatmap::pheatmap(test); -#' wplot_save_pheatmap(ph.test) - -wplot_save_pheatmap <- - function(x, - filename = substitute(x), - width = 15, - height = width) { - stopifnot(!missing(x)) - filename <- ppp(filename, ".heatmap.pdf") - pdf(file = filename, - width = width, - height = height) - grid::grid.newpage() - grid::grid.draw(x$gtable) - dev.off() - print(kpps(getwd(), filename)) - } - - #' wplot #' #' Create and save scatter plots as .pdf, in "OutDir". If mdlink = TRUE, it inserts a .pdf and a .png @@ -393,7 +365,7 @@ wplot_save_pheatmap <- #' @param df2col Input data frame to be plotted_2columns #' @param col Color of the plot. #' @param pch Define the symbol for each data point. A number [0-25] or any string between ""-s. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param plotname Title of the plot (main parameter) and also the name of the file. #' @param ylim manual Y-limits error bar @@ -433,7 +405,7 @@ wplot_save_pheatmap <- #' a = FALSE, b = FALSE, lty = 1, lwd = 1, col_abline = 1) wplot <- - function(df2col, + function (df2col, col = 1, pch = 18, ..., @@ -561,7 +533,7 @@ wplot <- #' A scatterplot with color gradient and color legend. Modified from: #' http://stackoverflow.com/questions/20127282/r-color-scatterplot-points-by-col-value-with-legend #' -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param xlab X axis label #' @param ylab Y axis label @@ -602,7 +574,7 @@ wplot <- wscatter.fill <- - function(df2col = cbind("A" = rnorm(100), "B" = rnorm(100)), + function (df2col = cbind("A" = rnorm(100), "B" = rnorm(100)), ..., color, xlim = range(df2col[, 1]), @@ -750,7 +722,7 @@ wscatter.fill <- #' link in the markdown report, set by "path_of_report". The .png version is not created, only the #' link is put in place, not to overwrite previous versions. #' @param variable The variable to plot. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param col Color of the plot. #' @param sub Subtitle below the plot. @@ -788,7 +760,7 @@ wscatter.fill <- #' arrow_width = 0.1, arrow_lwd = 1) wbarplot <- - function(variable, + function (variable, ..., col = unless.specified("b.def.colors", "gold1"), sub = FALSE, @@ -955,7 +927,7 @@ wbarplot <- #' @param lcol Color of the line. #' @param filtercol Color bars below / above the threshold with red / green. Define the direction by #' -1 or 1. Takes effect if "vline" is defined. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param filter filtervalues #' @param passequal Pass equal values @@ -971,7 +943,7 @@ wbarplot <- #' lcol = 2, filtercol = 0) whist <- - function(variable, + function (variable, ..., breaks = 20, col = unless.specified("b.def.color", "gold1"), @@ -1110,7 +1082,7 @@ whist <- #' link in the markdown report, set by "path_of_report". The .png version is not created, only the #' link is put in place, not to overwrite previous versions. #' @param yourlist The variable to plot. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param main Title of the plot and also the name of the file. #' @param sub Subtitle below the plot. @@ -1131,7 +1103,7 @@ whist <- #' tilted_text = FALSE, w = 7, mdlink = FALSE) wboxplot <- - function(yourlist, + function (yourlist, main = as.character(substitute(yourlist)), sub = FALSE, ylab = "", @@ -1202,7 +1174,7 @@ wboxplot <- #' link is put in place, not to overwrite previous versions. #' @param NamedVector The variable to plot. #' @param plotname Title of the plot (main parameter) and also the name of the file. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param percentage Display percentage instead of counts. TRUE by default. #' @param both_pc_and_value Report both percentage AND number. @@ -1218,7 +1190,7 @@ wboxplot <- #' w = 7, mdlink = FALSE) wpie <- - function(NamedVector, + function (NamedVector, percentage = TRUE, both_pc_and_value = FALSE, plotname = substitute(NamedVector), @@ -1289,7 +1261,7 @@ wpie <- #' link is put in place, not to overwrite previous versions. #' #' @param yourlist Input list to be plotted. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param main Title of the plot (main parameter) and also the name of the file. #' @param sub Subtitle below the plot. @@ -1324,7 +1296,7 @@ wpie <- #' wstripchart (yourlist = my.ls) wstripchart <- - function(yourlist, + function (yourlist, main = as.character(substitute(yourlist)), sub = NULL, ylab = "", @@ -1442,7 +1414,7 @@ wstripchart <- #' .pdf and a .png link in the markdown report, set by "path_of_report". The .png version is not #' created, only the link is put in place, not to overwrite previous versions. #' @param yourlist Input list to be plotted. -#' @param ... Pass any other parameter of the corresponding plotting function(most of them should +#' @param ... Pass any other parameter of the corresponding plotting function (most of them should #' work). #' @param main Title of the plot (main parameter) and also the name of the file. #' @param sub Subtitle below the plot. @@ -1476,110 +1448,110 @@ wstripchart <- #' metod = jitter, jitter = 0.2, w = 7, incrBottMarginBy = 0, tilted_text = FALSE, mdlink = FALSE) -wstripchart_list <- function(yourlist, - ..., - main = as.character(substitute(yourlist)), - sub = NULL, - ylab = "", - xlab = "", - border = 1, - bxpcol = 0, - pch = 18, - pchlwd = 1, - pchcex = 1.5, - incrBottMarginBy = 0, - tilted_text = FALSE, - bg = "chartreuse2", - col = "black", - metod = "jitter", - jitter = 0.2, - savefile = unless.specified("b.save.wplots"), - w = unless.specified("b.defSize"), - h = w, - mdlink = ww.set.mdlink(), - PNG = unless.specified("b.usepng", F)) { - fname = kollapse(main, ".stripchart") - if (incrBottMarginBy) { - .ParMarDefault <- par("mar") - par(mar = c(par("mar")[1] + incrBottMarginBy, par("mar")[2:4])) - } # Tune the margin - cexNsize = 1 / abs(log10(length(list))) - cexNsize = min(cexNsize, 1) - if (tilted_text) { - xlab = FALSE - } else { - xlab = TRUE - } - plotname <- - main # to avoid circular reference in the inside function argument - boxplot( - yourlist, - ..., - show.names = xlab, - main = plotname, - sub = sub, - border = border, - outpch = NA, - las = 2, - ylab = NA, - col = bxpcol, - cex.axis = cexNsize - ) - mtext(ylab, side = 2, line = 2) - for (i in 1:length(yourlist)) { - if (length(na.omit.strip(yourlist[[i]]))) { - j = k = i - if (length(1) < length(yourlist)) { - j = 1 - } - if (length(bg) < length(yourlist)) { - k = 1 - } - stripchart( - na.omit.strip(yourlist[[i]]), - at = i, - add = TRUE - , - vertical = TRUE, - method = "jitter", - jitter = jitter - , - pch = pch, - bg = bg[[k]], - col = col[[j]], - lwd = pchlwd, - cex = pchcex - ) +wstripchart_list <- function (yourlist, + ..., + main = as.character(substitute(yourlist)), + sub = NULL, + ylab = "", + xlab = "", + border = 1, + bxpcol = 0, + pch = 18, + pchlwd = 1, + pchcex = 1.5, + incrBottMarginBy = 0, + tilted_text = FALSE, + bg = "chartreuse2", + col = "black", + metod = "jitter", + jitter = 0.2, + savefile = unless.specified("b.save.wplots"), + w = unless.specified("b.defSize"), + h = w, + mdlink = ww.set.mdlink(), + PNG = unless.specified("b.usepng", F)) { + fname = kollapse(main, ".stripchart") + if (incrBottMarginBy) { + .ParMarDefault <- par("mar") + par(mar = c(par("mar")[1] + incrBottMarginBy, par("mar")[2:4])) + } # Tune the margin + cexNsize = 1 / abs(log10(length(list))) + cexNsize = min(cexNsize, 1) + if (tilted_text) { + xlab = FALSE + } else { + xlab = TRUE + } + plotname <- + main # to avoid circular reference in the inside function argument + boxplot( + yourlist, + ..., + show.names = xlab, + main = plotname, + sub = sub, + border = border, + outpch = NA, + las = 2, + ylab = NA, + col = bxpcol, + cex.axis = cexNsize + ) + mtext(ylab, side = 2, line = 2) + for (i in 1:length(yourlist)) { + if (length(na.omit.strip(yourlist[[i]]))) { + j = k = i + if (length(1) < length(yourlist)) { + j = 1 } - } # for - if (tilted_text) { - xx = min(unlist(yourlist), na.rm = TRUE) - text( - x = 1:length(yourlist), - y = xx, - labels = names(yourlist) + if (length(bg) < length(yourlist)) { + k = 1 + } + stripchart( + na.omit.strip(yourlist[[i]]), + at = i, + add = TRUE , - xpd = TRUE, - srt = 45, - adj = c(1, 3) - ) - } - if (savefile) { - ww.dev.copy( - PNG_ = PNG, - fname_ = fname, - w_ = w, - h_ = h + vertical = TRUE, + method = "jitter", + jitter = jitter + , + pch = pch, + bg = bg[[k]], + col = col[[j]], + lwd = pchlwd, + cex = pchcex ) } - if (incrBottMarginBy) { - par("mar" = .ParMarDefault) - } - ww.assign_to_global("plotnameLastPlot", fname, 1) - if (mdlink & savefile) { - md.image.linker(fname_wo_ext = fname) - } + } # for + if (tilted_text) { + xx = min(unlist(yourlist), na.rm = TRUE) + text( + x = 1:length(yourlist), + y = xx, + labels = names(yourlist) + , + xpd = TRUE, + srt = 45, + adj = c(1, 3) + ) } + if (savefile) { + ww.dev.copy( + PNG_ = PNG, + fname_ = fname, + w_ = w, + h_ = h + ) + } + if (incrBottMarginBy) { + par("mar" = .ParMarDefault) + } + ww.assign_to_global("plotnameLastPlot", fname, 1) + if (mdlink & savefile) { + md.image.linker(fname_wo_ext = fname) + } +} @@ -1593,7 +1565,7 @@ wstripchart_list <- function(yourlist, #' #' @param yourlist Input list to be plotted. #' @param ... Pass any other parameter of the corresponding -#' plotting function(most of them should work). +#' plotting function (most of them should work). #' @param main Title of the plot (main parameter) and also the name of the file. #' @param sub Subtitle below the plot. #' @param xlab X-axis label. @@ -1620,7 +1592,7 @@ wstripchart_list <- function(yourlist, wvioplot_list <- - function(yourlist, + function (yourlist, ..., main = as.character(substitute(yourlist)), sub = NULL, @@ -1728,7 +1700,7 @@ wvioplot_list <- #' not to overwrite previous versions. #' @param yourlist Input list to be plotted. #' @param ... Pass any other parameter of the corresponding plotting -#' function(most of them should work). +#' function (most of them should work). #' @param main Title of the plot (main parameter) and also the name of the file. #' @param sub Subtitle below the plot. #' @param xlab X-axis label. @@ -1759,7 +1731,7 @@ wvioplot_list <- #' # bg = 0, col = "black", metod = "jitter", jitter = 0.1, w = 7, mdlink = FALSE) wviostripchart_list <- - function(yourlist, + function (yourlist, ..., pch = 20, viocoll = c(2:(length(yourlist) + 1)), @@ -1874,7 +1846,7 @@ wviostripchart_list <- #' @param fill Background color vec #' @param subt Subtitle #' @param ... Pass any other parameter of the corresponding venn.diagram() -#' function(most of them should work). +#' function (most of them should work). #' @param w Width of the saved pdf image, in inches. #' @param h Height of the saved pdf image, in inches. #' @param mdlink Insert a .pdf and a .png image link in the markdown report, @@ -1888,7 +1860,7 @@ wviostripchart_list <- # @importFrom VennDiagram venn.diagram wvenn <- - function(yourlist, + function (yourlist, imagetype = "png", alpha = .5, fill = 1:length(yourlist), @@ -1955,7 +1927,7 @@ wvenn <- #' #' @param df Input data frame to be plotted #' @param ... Pass any other parameter of the corresponding -#' plotting function(most of them should work). +#' plotting function (most of them should work). #' @param col Color of the plot. #' @param savefile Save plot as pdf in OutDir, TRUE by default. #' @param w Width of the saved pdf image, in inches. @@ -1970,7 +1942,7 @@ wvenn <- wbarplot_dfCol <- - function(df, + function (df, ..., colName, col = unless.specified("b.def.colors", "gold1"), @@ -2009,12 +1981,12 @@ wbarplot_dfCol <- #' #' Use this version of whist() if you iterate over columns or rows of a data frame. #' You can name the file by naming the variable. -#' Cannot be used with dynamically called variables (e.g. call vectors within a loop). +#' Cannot be used with dynamically called variables [e.g. call vectors within a loop] #' #' @param df Input data frame to be plotted #' @param col Color of the plot. #' @param ... Pass any other parameter of the corresponding -#' plotting function(most of them should work). +#' plotting function (most of them should work). #' @param savefile Save plot as pdf in OutDir, TRUE by default. #' @param w Width of the saved pdf image, in inches. #' @param h Height of the saved pdf image, in inches. @@ -2028,7 +2000,7 @@ wbarplot_dfCol <- #' whist_dfCol (df, colName="a", col = "gold", w = 7) whist_dfCol <- - function(df, + function (df, colName, col = unless.specified("b.def.colors", "gold1"), ..., @@ -2088,7 +2060,7 @@ whist_dfCol <- #' Create A4 PDFs to plot multiple subplots in one file #' @param pname Title of the plot (main parameter) and also the name of the file. #' @param ... Pass any other parameter of the corresponding -#' plotting function(most of them should work). +#' plotting function (most of them should work). #' @param w Width of the saved pdf image, in inches. c("A4" = 8.27, "1col.nature" = 3.50, #' "2col.nature" = 7.20, "1col.cell" = 3.35, "1.5col.cell" = 4.49, "2col.cell" = 6.85). #' @param h Height of the saved pdf image, in inches. @@ -2106,7 +2078,7 @@ whist_dfCol <- pdfA4plot_on <- - function(pname = date(), + function (pname = date(), ..., w = unless.specified("b.defSize.fullpage", 8.27), h = 11.69, @@ -2160,7 +2132,7 @@ pdfA4plot_on <- pdfA4plot_on.layout <- - function(pname = date(), + function (pname = date(), ..., layout_mat = rbind(1, c(2, 3), 4:5), w = unless.specified("b.defSize.fullpage", 8.27), @@ -2201,7 +2173,7 @@ pdfA4plot_on.layout <- #' @examples pdfA4plot_on.layout(pname = "MyA4_w_layout"); hist(rnorm(100)); hist(-rnorm(100)) #' hist(10+rnorm(100)); pdfA4plot_off() -pdfA4plot_off <- function() { +pdfA4plot_off <- function () { x = if (exists("b.mfrow_def")) b.mfrow_def else @@ -2233,12 +2205,12 @@ pdfA4plot_off <- function() { #' @param lower Size of the lower error bar. By default, it equals the upper error bar. #' @param width.whisker Width of the error bar whisker. #' @param ... Pass any other argument to the arrows function. -#' arrows function(most of them should work). +#' arrows function (most of them should work). #' @export #' @examples plot (1); error_bar (x = 1, y = 1, upper = .1, width.whisker = 0.1) error_bar <- - function(x, + function (x, y, upper, lower = upper, @@ -2433,17 +2405,18 @@ wlegend.label <- #' @param w Width of the saved pdf image, in inches. #' @param h Height of the saved pdf image, in inches. #' @param ... Pass any other parameter of the corresponding -#' text function(most of them should work). +#' text function (most of them should work). #' @import graphics #' @export #' #' @examples barplot (1:10); -#' barplot_label(barplotted_variable = 1:10, labels = 11:2, filename = "myBarplot.pdf") +#' barplot_label (barplotted_variable = 1:10, labels = 11:2, filename = "myBarplot.pdf") + barplot_label <- - function(barplotted_variable, + function (barplotted_variable, labels = iround(barplotted_variable), bottom = FALSE, TopOffset = .5, @@ -2552,7 +2525,7 @@ wLinRegression <- #' @export #' @examples try.dev.off () -try.dev.off <- function() { +try.dev.off <- function () { try(dev.off(), silent = TRUE) } @@ -2700,7 +2673,7 @@ color_check <- function(..., incrBottMarginBy = 0, savefile = FALSE ) { #' @export #' @examples iprint ("Hello ", "you ", 3, ", ", 11, " year old kids.") -iprint <- function(...) { +iprint <- function (...) { argument_list <- c(...) print(paste(argument_list, collapse = " ")) } @@ -2716,11 +2689,11 @@ any_print = iprint # for compatibility #' @export #' @examples MyFriends = c("Peter", "Bence"); llprint ("My friends are: ", MyFriends ) -llprint <- function(...) { +llprint <- function (...) { argument_list <- c(...) LogEntry = print(paste(argument_list, collapse = " ")) if (ww.variable.and.path.exists(path_of_report, - alt.message = "NOT LOGGED: Log path and filename is not defined in path_of_report") ) { + alt.message = "NOT LOGGED: Log path and filename is not defined in path_of_report") ) { write(kollapse("\n", LogEntry, print = FALSE), path_of_report, append = TRUE) @@ -2737,12 +2710,12 @@ llprint <- function(...) { #' @export #' @examples MyFriends = c("Peter", "Bence"); llogit ("My friends are: ", MyFriends ) -llogit <- function(...) { +llogit <- function (...) { argument_list <- c(...) LogEntry = paste(argument_list, collapse = " ") LogEntry = gsub("^ +| +$", "", LogEntry) if (ww.variable.and.path.exists(path_of_report, - alt.message = "NOT LOGGED: Log path and filename is not defined in path_of_report")) { + alt.message = "NOT LOGGED: Log path and filename is not defined in path_of_report")) { write(kollapse("\n", LogEntry, print = FALSE), path_of_report, append = TRUE) @@ -2761,7 +2734,7 @@ llogit <- function(...) { #' @examples md.write.as.list() md.write.as.list <- - function(vector = 1:3, + function (vector = 1:3, h = 4, numbered = FALSE, ...) { @@ -2796,7 +2769,7 @@ md.write.as.list <- #' @examples md.image.linker (fname_wo_ext = "MyPlot" ) md.image.linker <- - function(fname_wo_ext, OutDir_ = ww.set.OutDir()) { + function (fname_wo_ext, OutDir_ = ww.set.OutDir()) { splt = strsplit(fname_wo_ext, "/") fn = splt[[1]][length(splt[[1]])] if (unless.specified("b.usepng")) { @@ -2857,23 +2830,20 @@ llwrite_list <- function(yourlist, printName = "self") { #' @param ManualName Specify full filename if you do not want to name it by the variable name. #' @param o Open the file after saving? FALSE by default #' @param gzip Compress the file after saving? FALSE by default -#' @param separator Field separator, such as "," for csv #' @param ... Pass any other argument to the kollapse() function used for file name. #' @export #' @examples YourDataFrameWithRowAndColumnNames = cbind("A" = rnorm(100), "B" = rpois(100, 8)) #' rownames(YourDataFrameWithRowAndColumnNames) = letters[1:NROW(YourDataFrameWithRowAndColumnNames)] #' write.simple.tsv(YourDataFrameWithRowAndColumnNames) -write.simple.tsv <- function(input_df, separator = "\t", extension = 'tsv', ManualName = "", o = FALSE, - gzip = FALSE, ... ) { - if (separator %in% c(',', ';')) extension <- 'csv' +write.simple.tsv <- function(input_df, extension = 'tsv', ManualName = "", o = FALSE, + gzip = FALSE , ... ) { fname = kollapse (..., print = FALSE); if (nchar (fname) < 2 ) { fname = substitute(input_df) } - if (nchar(ManualName)) {FnP = kollapse(ManualName) } else { FnP = ww.FnP_parser (fname, extension) } - utils::write.table (input_df, file = FnP, sep = separator, row.names = TRUE, + utils::write.table (input_df, file = FnP, sep = "\t", row.names = TRUE, col.names = NA, quote = FALSE ) - printme = if (length(dim(input_df))) { + printme = if(length(dim(input_df))) { paste0("Dim: ", dim(input_df) ) }else { paste0("Length (of your vector): ", length(input_df) ) @@ -2899,7 +2869,7 @@ write.simple.tsv <- function(input_df, separator = "\t", extension = 'tsv', Manu md.import <- function(from.file, to.file = path_of_report) { linez = readLines(from.file) if (ww.variable.and.path.exists(path_of_report, - alt.message = "Log path and filename is not defined in path_of_report")) { + alt.message = "Log path and filename is not defined in path_of_report")) { iprint(length(linez),"lines from",basename(from.file) , "are concatenated to:",basename(path_of_report)) } @@ -2920,7 +2890,7 @@ md.import <- function(from.file, to.file = path_of_report) { #' @export #' @examples md.LogSettingsFromList(parameterlist = list("min" = 4, "method" = "pearson", "max" = 10)) -md.LogSettingsFromList <- function(parameterlist, +md.LogSettingsFromList <- function (parameterlist, maxlen = 20) { LZ = unlist(lapply(parameterlist, length)) # collapse paramters with multiple entires LNG = names(which(LZ > 1)) @@ -2935,44 +2905,13 @@ md.LogSettingsFromList <- function(parameterlist, } -# Writing markdown tables -------------------------------------------------------------------------- - -#' md.List2Table -#' -#' Broader variant of md.LogSettingsFromList(). Log the values (col2) from a named (col1) list, in a table format -#' in the report. -#' @param title Title of the table. -#' @param colname2 Name of the 2nd column. -#' @param parameterlist List of Paramters. -#' @param maxlen Maximum length of entries in a parameter list element,. -#' @export -#' @examples md.LogSettingsFromList(parameterlist = list("min" = 4, "method" = "pearson", "max" = 10)) - -md.List2Table <- function(parameterlist, - title="List elements", - colname2="Value", - maxlen = 20) { - LZ = unlist(lapply(parameterlist, length)) # collapse paramters with multiple entires - LNG = names(which(LZ > 1)) - for (i in LNG) { - if (length(parameterlist[[i]]) > maxlen) - parameterlist[[i]] = parameterlist[[i]][1:maxlen] - parameterlist[[i]] = paste(parameterlist[[i]], collapse = ", ") - } #for - DF = t(as.data.frame(parameterlist)) - colnames(DF) = colname2 - md.tableWriter.DF.w.dimnames(DF, title_of_table = title) -} - - - #' md.tableWriter.DF.w.dimnames #' #' Take an R data frame with row- and column- names, parse a markdown table from it, #' and write it to the markdown report, set by "path_of_report". #' @param df Input data frame to be plotted #' @param FullPath Full path to the file. -#' @param percentify Format numbers between 0-1 to percentages 0-100. +#' @param percentify Format numbers [0, 1] to percentages 0-100. #' @param title_of_table Title above the table (in the markdown report). #' @param print2screen Print the markdown formatted table to the sceen. #' @param WriteOut Write the table into a TSV file. @@ -2982,7 +2921,7 @@ md.List2Table <- function(parameterlist, md.tableWriter.DF.w.dimnames <- - function(df, + function (df, FullPath = ww.set.path_of_report(), percentify = FALSE, title_of_table = NA, @@ -3058,7 +2997,7 @@ md.tableWriter.DF.w.dimnames <- #' md.tableWriter.VEC.w.names (NamedVector = x, percentify = FALSE, title_of_table = NA) md.tableWriter.VEC.w.names <- - function(NamedVector, + function (NamedVector, FullPath = ww.set.path_of_report(), percentify = FALSE, title_of_table = NA, @@ -3112,28 +3051,6 @@ md.tableWriter.VEC.w.names <- - -#' md.LinkTable -#' -#' Take a dataframe where every entry is a string containing an html link, parse and write out. -#' a properly formatted markdown table. -#' @param tableOfLinkswRownames A dataframe where every entry is a string containing an html link. -#' @export -#' -#' @examples tableOfLinkswRownames(tableOfLinkswRownames = df_of_LinksParsedByDatabaseLinkeR) - -md.LinkTable <- function(tableOfLinkswRownames) { - TBL = tableOfLinkswRownames - RN = rownames(tableOfLinkswRownames) - for (i in 1:ncol(tableOfLinkswRownames)) { - x = tableOfLinkswRownames[, i] - TBL[, i] = paste0("[", RN, "]", "(", x, ")") - } #for - md.tableWriter.DF.w.dimnames(TBL, - FullPath = paste0(OutDir, substitute(tableOfLinkswRownames), ".tsv.md")) -} - - #' md.import.table #' #' Import a table (.csv, or tab seprated values, .tsv file) and write it @@ -3160,7 +3077,7 @@ md.import.table <- field.sep = "\t", to.file = path_of_report) { TTL = if (missing(title_of_table)){ - basename(from.file.table) + basename(from.file.table) } else { title_of_table} importedtable = if (has.rownames) { utils::read.table( @@ -3413,9 +3330,9 @@ stopif <- #' @param x Unrounded number. #' @param digitz Number of digits to keep. 3 by default. #' @export -#' @examples iround(x = 2.3232, digitz = 3) +#' @examples iround (x = 2.3232, digitz = 3) -iround <- function(x, digitz = 3) { +iround <- function (x, digitz = 3) { signif(x, digits = digitz) } @@ -3461,7 +3378,7 @@ modus <- function(x) { #' #' @examples as.factor.numeric(LETTERS[1:4]) -as.factor.numeric <- function(vec, rename = FALSE, ...) { +as.factor.numeric <- function (vec, rename = FALSE, ...) { vec2 = as.numeric(as.factor(vec, ...)) ; names (vec2) <- if ( !rename & !is.null(names(vec) ) ) { names (vec) } else { vec } @@ -3508,7 +3425,7 @@ na.omit.strip <- function(object, silent = FALSE, ...) { #' @examples kollapse("Hello ", LETTERS[24], #' ", the winning numbers are ", c(1, 3, 5, 65, 11), " . Yay!") -kollapse <- function(..., +kollapse <- function (..., collapseby = "", print = TRUE) { if (print == TRUE) { @@ -3525,20 +3442,20 @@ kollapse <- function(..., #' @export #' @examples substrRight ("Not cool", n = 4) -substrRight <- function(x, n) { +substrRight <- function (x, n) { substr(x, nchar(x) - n + 1, nchar(x)) } #' percentage_formatter #' #' Parse a string of 0-100% from a number between 0 and 1. -#' @param x A vector of numbers between 0-1. +#' @param x A vector of numbers between [0, 1]/ #' @param digitz Number of digits to keep. 3 by default. #' @export #' @examples percentage_formatter (x = 4.2822212, digitz = 3) -percentage_formatter <- function(x, digitz = 3) { - a = paste(100 * signif(x, digitz), "%", sep = " ") +percentage_formatter <- function (x, digitz = 3) { + a = paste(100 * iround(x, digitz), "%", sep = " ") a[a == "NaN %"] = NaN a[a == "NA %"] = NA return(a) @@ -3749,8 +3666,10 @@ ww.set.OutDir <- function() { iprint("OutDir not defined !!! Saving in working directory.") paste0(getwd(),"/", collapse = "") } - NewOutDir = AddTrailingSlash(NewOutDir) # add '/' if necessary - RemoveDoubleSlash(NewOutDir) + if (!substrRight(NewOutDir, 1) == "/"){ + NewOutDir = paste0(NewOutDir, "/") # add '/' if necessary + } + gsub(x = NewOutDir, pattern = '//', replacement = '/') } @@ -3839,7 +3758,7 @@ ww.set.mdlink <- function(NameOfaVariable = "b.mdlink", #' @examples ww.md.image.link.parser ("/MyPlot.jpg" ) #' ww.md.image.link.parser (getwd(),"/MyPlot.jpg" ) -ww.md.image.link.parser <- function(...) { +ww.md.image.link.parser <- function (...) { FullPath = kollapse(..., print = FALSE) splt = strsplit(FullPath, "/") fn = splt[[1]][length(splt[[1]])] @@ -3853,7 +3772,7 @@ ww.md.image.link.parser <- function(...) { #' @export #' @examples ww.ttl_field("/Users/myplot.jpg") -ww.ttl_field <- function(flname) { +ww.ttl_field <- function (flname) { paste0(basename(flname), " by ", if (exists("b.scriptname")) b.scriptname else @@ -3868,7 +3787,7 @@ ww.ttl_field <- function(flname) { #' @export #' @examples ww.autoPlotName() -ww.autoPlotName <- function(name = NULL) { +ww.autoPlotName <- function (name = NULL) { if (is.null(name)) { filename = if (exists("plotnameLastPlot")) { plotnameLastPlot @@ -3886,7 +3805,7 @@ ww.autoPlotName <- function(name = NULL) { #' #' Parser for dev.copy to save as PDF or PNG #' @param PNG_ Set to true if you want to save the plot as PNG instead of the default PDF. -#' @param PNG_res deafult 450 +#' @param PNG_res default 100 #' @param w_ Width of the saved pdf image, in inches. #' @param h_ Height of the saved pdf image, in inches. #' @param fname_ File name @@ -3894,13 +3813,13 @@ ww.autoPlotName <- function(name = NULL) { #' @examples try.dev.off(); plot(1); # ww.dev.copy(PNG = FALSE, w_ = 7, h_ = 7, fname_ = "myNewplot") ww.dev.copy <- function(PNG_ = FALSE, - PNG_res = 450, + PNG_res = 100, w_, h_, fname_) { if (PNG_) { dev.copy( - png, + device = png, filename = ww.FnP_parser(fname_, "png"), res = PNG_res, width = w_ * 100, @@ -3953,7 +3872,7 @@ ww.assign_to_global <- function(name, value, pos=1){ #' append = TRUE, b.png4Github = TRUE) setup_logging_markdown <- - function(fname, + function (fname, title = "", append = TRUE, b.png4Github = TRUE) { @@ -3970,7 +3889,7 @@ setup_logging_markdown <- path_of_report, append = TRUE) BackupDir = kollapse( OutDir, "/", substr(fname, 1, nchar(fname)), "_", - format(Sys.time(), "%Y_%m_%d-%Hh"), print = FALSE + format(Sys.time(), "%Y_%m_%d-%Hh"), print = FALSE ) if (!exists(BackupDir)) { dir.create(BackupDir, showWarnings = FALSE) @@ -3987,7 +3906,7 @@ setup_logging_markdown <- #' @export #' @examples a = 1; b = 2; log_settings_MarkDown (a,b) -log_settings_MarkDown <- function(...) { +log_settings_MarkDown <- function (...) { print("Use md.LogSettingsFromList() for a list of parameters") call <- match.call() namez = sapply(as.list(call[-1]), deparse) @@ -3999,79 +3918,3 @@ log_settings_MarkDown <- function(...) { -#' AddTrailingSlash -#' -#' Adds a final slash '/', if missing from a string (file path). -#' @param string The file path potentially missing the trailing slash -#' @export -#' -#' @examples AddTrailingSlash (string = "stairway/to/heaven") - -AddTrailingSlash <- function(string = "stairway/to/heaven") { # - LastChr <- substr(string, nchar(string), nchar(string)) - if (!LastChr == "/") - string = paste0(string, "/") - return(string) -} - -#' RemoveDoubleSlash -#' -#' RemoveDoubleSlash removes multiple consecutive slashes (e.g. '//') from a string (file path). Also works for 2,3 consecutive slashes -#' @param string The file path potentially having Double Slash -#' @export -#' -#' @examples RemoveDoubleSlash (string = "stairway//to///heaven") - -RemoveDoubleSlash <- function(string = "stairway//to/heaven") { # - gsub(x = string, pattern = '//|///|////', replacement = '/') -} - - -#' RemoveFinalSlash -#' -#' RemoveFinalSlash removes the final slash from a string -#' @param string The file path potentially having Final Slash -#' @export -#' -#' @examples RemoveDoubleSlash (string = "stairway//to///heaven") - -RemoveFinalSlash <- function(string = "stairway/to/heaven/") { # - gsub(x = string, pattern = '/$', replacement = '') -} - - - -#' FixPath -#' -#' FixPath removes multiple consecutive slashes (e.g. '//') from a string and adds a final '/' if missing from a file path. -#' @param string The file path potentially having Double Slash -#' @export -#' -#' @examples FixPath(string = "stairway//to/heaven") - -FixPath <- function(string = "stairway//to/heaven") { # - string <- gsub(x = string, pattern = '//|///|////', replacement = '/') - LastChr <- substr(string, nchar(string), nchar(string)) - if (!LastChr == "/") - string = paste0(string, "/") - return(string) -} - - -#' ParseFilePath -#' -#' ParseFilePath pastes elements by slash, then removes Double Slashes '//' from a string and adds a final '/' if missing from a file path. -#' @param ... The set of strings (character vectors) to be parsed into a file path, and potentially having Double Slashes, potentially missing a trailing slash. -#' @export -#' -#' @examples ParseFilePath(string = "stairway///to/heaven") - -ParseFilePath <- function(...) { # - string <- paste(..., sep = '/', collapse = '/') # kollapse by (forward) slash - string <- gsub(x = string, pattern = '//', replacement = '/') # RemoveDoubleSlash - LastChr <- substr(string, nchar(string), nchar(string)) # AddTrailingSlash - if (!LastChr == "/") - string = paste0(string, "/") - return(string) -} - diff --git a/man/create_set_Original_OutDir.Rd b/man/create_set_Original_OutDir.Rd index df4644c..52a2fd7 100644 --- a/man/create_set_Original_OutDir.Rd +++ b/man/create_set_Original_OutDir.Rd @@ -4,7 +4,7 @@ \alias{create_set_Original_OutDir} \title{Closing pair of the create_set_SubDir function. Call when chaning back to the main dir. Set the output directory of the script, and set the "NewOutDir" variable that is - used by all ~wplot functions.} +used by all ~wplot functions.} \usage{ create_set_Original_OutDir( NewOutDir = OutDirOrig, @@ -25,7 +25,7 @@ create_set_Original_OutDir( \description{ Closing pair of the create_set_SubDir function. Call when chaning back to the main dir. Set the output directory of the script, and set the "NewOutDir" variable that is - used by all ~wplot functions. +used by all ~wplot functions. } \examples{ create_set_Original_OutDir (getwd(),"/") diff --git a/man/md.LogSettingsFromList.Rd b/man/md.LogSettingsFromList.Rd index dbe5c32..c299249 100644 --- a/man/md.LogSettingsFromList.Rd +++ b/man/md.LogSettingsFromList.Rd @@ -13,7 +13,7 @@ md.LogSettingsFromList(parameterlist, maxlen = 20) } \description{ Log the parameters & settings used in the script and stored in a list, in a table format - in the report. +in the report. } \examples{ md.LogSettingsFromList(parameterlist = list("min" = 4, "method" = "pearson", "max" = 10)) diff --git a/man/md.import.table.Rd b/man/md.import.table.Rd index e1884aa..e7a70c9 100644 --- a/man/md.import.table.Rd +++ b/man/md.import.table.Rd @@ -33,6 +33,6 @@ Import a table (.csv, or tab seprated values, .tsv file) and write it in markdown format to the report. } \examples{ -x = matrix(1:9,3); utils::write.table(x, sep = "\\t", file = "~/x.tsv"); +x = matrix(1:9,3); utils::write.table(x, sep = "\t", file = "~/x.tsv"); md.import.table("~/x.tsv") } diff --git a/man/md.tableWriter.DF.w.dimnames.Rd b/man/md.tableWriter.DF.w.dimnames.Rd index 776d987..bd279cc 100644 --- a/man/md.tableWriter.DF.w.dimnames.Rd +++ b/man/md.tableWriter.DF.w.dimnames.Rd @@ -18,7 +18,7 @@ md.tableWriter.DF.w.dimnames( \item{FullPath}{Full path to the file.} -\item{percentify}{Format numbers [0, 1] to percentages 0-100.} +\item{percentify}{Format numbers \link{0, 1} to percentages 0-100.} \item{title_of_table}{Title above the table (in the markdown report).} diff --git a/man/md.tableWriter.VEC.w.names.Rd b/man/md.tableWriter.VEC.w.names.Rd index 4f13d20..c39052f 100644 --- a/man/md.tableWriter.VEC.w.names.Rd +++ b/man/md.tableWriter.VEC.w.names.Rd @@ -18,7 +18,7 @@ md.tableWriter.VEC.w.names( \item{FullPath}{Full path to the file.} -\item{percentify}{Format numbers [0, 1] to percentages 0-100.} +\item{percentify}{Format numbers \link{0, 1} to percentages 0-100.} \item{title_of_table}{Title above the table (in the markdown report).} @@ -28,7 +28,7 @@ md.tableWriter.VEC.w.names( } \description{ Take an R vector with names, parse a markdown table from it, and write it to the markdown report, - set by "path_of_report". +set by "path_of_report". } \examples{ x = -1:2; names(x) = LETTERS[1:4] diff --git a/man/percentage_formatter.Rd b/man/percentage_formatter.Rd index fa34452..7c8144a 100644 --- a/man/percentage_formatter.Rd +++ b/man/percentage_formatter.Rd @@ -7,12 +7,12 @@ percentage_formatter(x, digitz = 3) } \arguments{ -\item{x}{A vector of numbers between [0, 1]/} +\item{x}{A vector of numbers between \link{0, 1}/} \item{digitz}{Number of digits to keep. 3 by default.} } \description{ -Parse a string of 0-100% from a number between 0 and 1. +Parse a string of 0-100\% from a number between 0 and 1. } \examples{ percentage_formatter (x = 4.2822212, digitz = 3) diff --git a/man/setup_MarkdownReports.Rd b/man/setup_MarkdownReports.Rd index e8f0440..3fe531b 100644 --- a/man/setup_MarkdownReports.Rd +++ b/man/setup_MarkdownReports.Rd @@ -46,7 +46,7 @@ into the timestamped subfolder within the OutDir.} \item{append}{Set append to TRUE if you do not want to overwrite the previous report.} -\item{addTableOfContents}{write '[TOC]' below the header of the file, This is compiled to a +\item{addTableOfContents}{write '\link{TOC}' below the header of the file, This is compiled to a proper Table Of Contents by, e.g. Typora.} \item{saveSessionInfo}{save 'sessioninfo::session_info()' results to '.session_info.DATE.txt.gz'} diff --git a/man/setup_logging_markdown.Rd b/man/setup_logging_markdown.Rd index 38ea402..3daf5a2 100644 --- a/man/setup_logging_markdown.Rd +++ b/man/setup_logging_markdown.Rd @@ -17,7 +17,7 @@ Use continue_logging_markdown() if you return logging into an existing report.} \item{b.png4Github}{A global variable, defined by this and used by the other functions. If TRUE (default), any link to the .png versions of images will be created in a GitHub compatible format. That means, when you upload your markdown report and the .png images - to your GitHub wiki under "Reports/" the links will correctly display the images online.} +to your GitHub wiki under "Reports/" the links will correctly display the images online.} } \description{ Setup the markdown report file, create a sub directory in "OutDir". Its name is stamped with diff --git a/man/whist.Rd b/man/whist.Rd index 32f33fd..07a70d9 100644 --- a/man/whist.Rd +++ b/man/whist.Rd @@ -73,7 +73,7 @@ Design the line by "lty", "lwd" & "lcol" parameters.} Create and save histograms as .pdf, in "OutDir". If mdlink = TRUE, it inserts a .pdf and a .png link in the markdown report, set by "path_of_report". The .png version is not created, only the link is put in place, not to overwrite previous versions. Name the file by naming the variable! -Cannot be used with dynamically called variables [e.g. call vectors within a loop]. "filtercol" +Cannot be used with dynamically called variables \link{e.g. call vectors within a loop}. "filtercol" assumes >= coloring! } \examples{ diff --git a/man/whist_dfCol.Rd b/man/whist_dfCol.Rd index a8a7873..c65ec8d 100644 --- a/man/whist_dfCol.Rd +++ b/man/whist_dfCol.Rd @@ -36,7 +36,7 @@ plotting function (most of them should work).} \description{ Use this version of whist() if you iterate over columns or rows of a data frame. You can name the file by naming the variable. -Cannot be used with dynamically called variables [e.g. call vectors within a loop] +Cannot be used with dynamically called variables \link{e.g. call vectors within a loop} } \examples{ try.dev.off(); df = cbind(a = rnorm(1:10), b = rnorm(10)) diff --git a/man/wplot.Rd b/man/wplot.Rd index cf83b0c..87711b5 100644 --- a/man/wplot.Rd +++ b/man/wplot.Rd @@ -40,7 +40,7 @@ wplot( \item{col}{Color of the plot.} -\item{pch}{Define the symbol for each data point. A number [0-25] or any string between ""-s.} +\item{pch}{Define the symbol for each data point. A number \link{0-25} or any string between ""-s.} \item{...}{Pass any other parameter of the corresponding plotting function (most of them should work).} diff --git a/man/wscatter.fill.Rd b/man/wscatter.fill.Rd index 4ba18fd..11b04bd 100644 --- a/man/wscatter.fill.Rd +++ b/man/wscatter.fill.Rd @@ -51,7 +51,7 @@ work).} \item{nlevels}{Number of steps in the color gradient} -\item{pch}{Define the symbol for each data point. A number [0-25] or any string between ""-s.} +\item{pch}{Define the symbol for each data point. A number \link{0-25} or any string between ""-s.} \item{cex}{Size of the symbols} diff --git a/man/wstripchart.Rd b/man/wstripchart.Rd index 234be8c..f014793 100644 --- a/man/wstripchart.Rd +++ b/man/wstripchart.Rd @@ -56,7 +56,7 @@ stripchart().} \item{jitter}{The amount of horizontal scatter added to the individual data points (to avoid overlaps).} -\item{pch}{Define the symbol for each data point. A number [0-25] or any string between ""-s.} +\item{pch}{Define the symbol for each data point. A number \link{0-25} or any string between ""-s.} \item{pchlwd}{Define the outline width of the symbol for each data point.} diff --git a/man/wstripchart_list.Rd b/man/wstripchart_list.Rd index 04bca58..91821f6 100644 --- a/man/wstripchart_list.Rd +++ b/man/wstripchart_list.Rd @@ -48,7 +48,7 @@ are recycled if the length of border is less than the number of plots.} \item{bxpcol}{Color of the boxplot outlines.} -\item{pch}{Define the symbol for each data point. A number [0-25] or any string between ""-s.} +\item{pch}{Define the symbol for each data point. A number \link{0-25} or any string between ""-s.} \item{pchlwd}{Define the outline width of the symbol for each data point.} diff --git a/man/wviostripchart_list.Rd b/man/wviostripchart_list.Rd index b8b1754..8e44650 100644 --- a/man/wviostripchart_list.Rd +++ b/man/wviostripchart_list.Rd @@ -32,7 +32,7 @@ wviostripchart_list( \item{...}{Pass any other parameter of the corresponding plotting function (most of them should work).} -\item{pch}{Define the symbol for each data point. A number [0-25] or any string between ""-s.} +\item{pch}{Define the symbol for each data point. A number \link{0-25} or any string between ""-s.} \item{viocoll}{Background color of each individual violing plot.} diff --git a/man/ww.dev.copy.Rd b/man/ww.dev.copy.Rd index 87b0b0c..7935e67 100644 --- a/man/ww.dev.copy.Rd +++ b/man/ww.dev.copy.Rd @@ -4,12 +4,12 @@ \alias{ww.dev.copy} \title{ww.dev.copy} \usage{ -ww.dev.copy(PNG_ = FALSE, PNG_res = 450, w_, h_, fname_) +ww.dev.copy(PNG_ = FALSE, PNG_res = 100, w_, h_, fname_) } \arguments{ \item{PNG_}{Set to true if you want to save the plot as PNG instead of the default PDF.} -\item{PNG_res}{deafult 450} +\item{PNG_res}{default 100} \item{w_}{Width of the saved pdf image, in inches.} diff --git a/man/ww.set.mdlink.Rd b/man/ww.set.mdlink.Rd index 27f2289..ea0ea84 100644 --- a/man/ww.set.mdlink.Rd +++ b/man/ww.set.mdlink.Rd @@ -14,7 +14,7 @@ ww.set.mdlink(NameOfaVariable = "b.mdlink", def = FALSE) \description{ Internal function. Sets inserting a markdown link to the image (created by the wplot* function that calls this function) only if 'path_of_report' is defined - and 'b.mdlink' is defined as TRUE. +and 'b.mdlink' is defined as TRUE. } \examples{ ww.set.mdlink() # It is an internal function, not intended for manual use. diff --git a/man/ww.variable.and.path.exists.Rd b/man/ww.variable.and.path.exists.Rd index aa93b8d..2c7fc4c 100644 --- a/man/ww.variable.and.path.exists.Rd +++ b/man/ww.variable.and.path.exists.Rd @@ -13,7 +13,7 @@ ww.variable.and.path.exists(path = path_of_report, alt.message = NULL) } \description{ Check if a variable name is defined, and if so, does the path (to a file) stored in that - variable points to an existing directory? +variable points to an existing directory? } \examples{ ww.variable.and.path.exists(path = B, alt.message = "Hello, your path/var does not exist.")