Skip to content

Commit

Permalink
Update of MarkdownReports
Browse files Browse the repository at this point in the history
Updated / new functions:
- substrRight
- setup_MarkdownReports
- md.LogSettingsFromList
- log_settings_MarkDown
- llwrite_list
- wlegend
- wLinRegression
- wscatter.fill
  • Loading branch information
vertesy committed Sep 11, 2017
1 parent 61c103c commit d699019
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Development/Create_the_MarkdownReports_Package.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DESCRIPTION <- list("Title" = "Generate Scientific Figures and Reports Easily",
3. Link & display your figures automatically inside your report, right there where they are needed.
4. Version your findings, annotating which parameters were used to reach certain results.
5. Share your report with others via email, Github or a personal website.", "License" = "GNU GPL 3",
"Version"= "2.8", "Imports" = "vioplot, gplots, VennDiagram"
"Version"= "2.8.1", "Imports" = "vioplot, gplots, VennDiagram"
)

setwd(RepositoryDir)
Expand Down
20 changes: 12 additions & 8 deletions MarkdownReports/R/MarkdownReports.R
Original file line number Diff line number Diff line change
Expand Up @@ -488,20 +488,24 @@ wplot <-function (df_2columns, col = 1, pch = 18, ..., plotname = substitute(df_



wscatter.fill <- function (x, y, ..., color, xlim=range(x), ylim=range(y), zlim=range(color),
nlevels = 20, pch=21, cex=1,
plotname = substitute(variable), plot.title = plotname, xlb = substitute(x), ylb = substitute(y),
wscatter.fill <- function (df2col = cbind("A"=rnorm(100), "B"=rnorm(100)), ..., color, xlim=range(df2col[,1]), ylim=range(df2col[,2]), zlim=range(color), nlevels = 20, pch=21, cex=1,
plotname = substitute(df2col), plot.title = plotname,
plot.axes, key.title, key.axes, asp = NA, xaxs = "i", yaxs = "i", las = 1,
axes = TRUE, frame.plot = axes,
axes = TRUE, frame.plot = axes, xlb, ylb,
savefile = T, w = 7, h = w, incrBottMarginBy = 0, mdlink = F ) {
x = df2col[,1]
y = df2col[,2]
CNN = colnames(df2col)
xlb = if(length(CNN) & missing(xlb)) CNN[1]
ylb = if(length(CNN) & missing(ylb)) CNN[2]

fname = kollapse(plotname, ".barplot")
if (incrBottMarginBy) { .ParMarDefault <- par("mar"); par(mar=c(par("mar")[1]+incrBottMarginBy, par("mar")[2:4]) ) } # Tune the margin

mar.orig <- (par.orig <- par(c("mar", "las", "mfrow")))$mar
on.exit(par(par.orig))
w <- (3 + mar.orig[2L]) * par("csi") * 2.54
layout(matrix(c(2, 1), ncol = 2L), widths = c(1, lcm(w)))
WID <- (3 + mar.orig[2L]) * par("csi") * 2.54
layout(matrix(c(2, 1), ncol = 2L), widths = c(1, lcm(WID)))
par(las = las)
mar <- mar.orig
mar[4L] <- mar[2L]
Expand All @@ -526,8 +530,8 @@ wscatter.fill <- function (x, y, ..., color, xlim=range(x), ylim=range(y), zlim=
par(mar = mar)

# points
plot(x, y, main =plot.title, type = "n", xaxt='n', yaxt='n', ..., xlim=xlim, ylim=ylim, bty="n")
points(x, y, bg = colz, xaxt='n', yaxt='n', xlab="", ylab="", bty="n", pch=pch, ...)
plot(x, y, main =plot.title, type = "n", xaxt='n', yaxt='n', ..., xlim=xlim, ylim=ylim, bty="n", xlab=xlb, ylab=ylb)
points(x, y, bg = colz, xaxt='n', yaxt='n', xlab="", ylab="", bty="n", pch=pch,...)

## options to make mapping more customizable
if (missing(plot.axes)) {
Expand Down
20 changes: 12 additions & 8 deletions MarkdownReports/R/MarkdownReports.R.bac
Original file line number Diff line number Diff line change
Expand Up @@ -488,20 +488,24 @@ wplot <-function (df_2columns, col = 1, pch = 18, ..., plotname = substitute(df_



wscatter.fill <- function (x, y, ..., color, xlim=range(x), ylim=range(y), zlim=range(color),
nlevels = 20, pch=21, cex=1,
plotname = substitute(variable), plot.title = plotname, xlb = substitute(x), ylb = substitute(y),
wscatter.fill <- function (df2col = cbind("A"=rnorm(100), "B"=rnorm(100)), ..., color, xlim=range(df2col[,1]), ylim=range(df2col[,2]), zlim=range(color), nlevels = 20, pch=21, cex=1,
plotname = substitute(df2col), plot.title = plotname,
plot.axes, key.title, key.axes, asp = NA, xaxs = "i", yaxs = "i", las = 1,
axes = TRUE, frame.plot = axes,
axes = TRUE, frame.plot = axes, xlb, ylb,
savefile = T, w = 7, h = w, incrBottMarginBy = 0, mdlink = F ) {
x = df2col[,1]
y = df2col[,2]
CNN = colnames(df2col)
xlb = if(length(CNN) & missing(xlb)) CNN[1]
ylb = if(length(CNN) & missing(ylb)) CNN[2]

fname = kollapse(plotname, ".barplot")
if (incrBottMarginBy) { .ParMarDefault <- par("mar"); par(mar=c(par("mar")[1]+incrBottMarginBy, par("mar")[2:4]) ) } # Tune the margin

mar.orig <- (par.orig <- par(c("mar", "las", "mfrow")))$mar
on.exit(par(par.orig))
w <- (3 + mar.orig[2L]) * par("csi") * 2.54
layout(matrix(c(2, 1), ncol = 2L), widths = c(1, lcm(w)))
WID <- (3 + mar.orig[2L]) * par("csi") * 2.54
layout(matrix(c(2, 1), ncol = 2L), widths = c(1, lcm(WID)))
par(las = las)
mar <- mar.orig
mar[4L] <- mar[2L]
Expand All @@ -526,8 +530,8 @@ wscatter.fill <- function (x, y, ..., color, xlim=range(x), ylim=range(y), zlim=
par(mar = mar)

# points
plot(x, y, main =plot.title, type = "n", xaxt='n', yaxt='n', ..., xlim=xlim, ylim=ylim, bty="n")
points(x, y, bg = colz, xaxt='n', yaxt='n', xlab="", ylab="", bty="n", pch=pch, ...)
plot(x, y, main =plot.title, type = "n", xaxt='n', yaxt='n', ..., xlim=xlim, ylim=ylim, bty="n", xlab=xlb, ylab=ylb)
points(x, y, bg = colz, xaxt='n', yaxt='n', xlab="", ylab="", bty="n", pch=pch,...)

## options to make mapping more customizable
if (missing(plot.axes)) {
Expand Down
20 changes: 10 additions & 10 deletions MarkdownReports/man/wscatter.fill.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d699019

Please sign in to comment.