From 6acc218f771582eff57726d183911199d5ae4790 Mon Sep 17 00:00:00 2001 From: Manny Gimond Date: Thu, 28 Dec 2023 20:46:44 -0500 Subject: [PATCH] a few more edits --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/eda_3pt.R | 7 ++++--- R/eda_bipow.R | 18 +++++++++++++----- R/eda_boxls.R | 9 ++++++--- R/eda_dens.R | 7 ++++--- R/eda_lm.R | 7 ++++--- R/eda_normfit.R | 7 ++++--- R/eda_qq.R | 7 ++++--- R/eda_sl.R | 7 ++++--- R/plot.eda_polish.R | 9 +++++---- R/plot.eda_rline.R | 7 ++++--- docs/404.html | 2 +- docs/LICENSE-text.html | 2 +- docs/articles/RLine.html | 12 ++++++------ .../figure-html/unnamed-chunk-22-1.png | Bin 19214 -> 19429 bytes .../figure-html/unnamed-chunk-25-1.png | Bin 20661 -> 20931 bytes docs/articles/index.html | 2 +- docs/articles/polish.html | 2 +- docs/articles/qq.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 4 ++-- docs/pkgdown.yml | 2 +- docs/reference/Rplot001.png | Bin 20419 -> 20151 bytes docs/reference/Rplot002.png | Bin 19726 -> 19489 bytes docs/reference/Rplot003.png | Bin 13855 -> 13613 bytes docs/reference/Rplot004.png | Bin 11312 -> 12499 bytes docs/reference/Rplot005.png | Bin 15705 -> 15766 bytes docs/reference/Rplot006.png | Bin 14149 -> 14313 bytes docs/reference/Rplot007.png | Bin 14658 -> 14556 bytes docs/reference/Rplot008.png | Bin 17107 -> 16599 bytes docs/reference/Rplot009.png | Bin 18132 -> 18435 bytes docs/reference/age_height.html | 4 ++-- docs/reference/eda_3pt-1.png | Bin 81181 -> 81620 bytes docs/reference/eda_3pt-2.png | Bin 73407 -> 73832 bytes docs/reference/eda_3pt.html | 4 ++-- docs/reference/eda_add-1.png | Bin 69413 -> 69000 bytes docs/reference/eda_add.html | 4 ++-- docs/reference/eda_bipow-1.png | Bin 271801 -> 263397 bytes docs/reference/eda_bipow.html | 17 +++++++++++++---- docs/reference/eda_boxls-1.png | Bin 20793 -> 20793 bytes docs/reference/eda_boxls-2.png | Bin 20953 -> 20953 bytes docs/reference/eda_boxls-3.png | Bin 20247 -> 20171 bytes docs/reference/eda_boxls-4.png | Bin 17945 -> 17845 bytes docs/reference/eda_boxls-5.png | Bin 21868 -> 22497 bytes docs/reference/eda_boxls.html | 4 ++-- docs/reference/eda_dens-1.png | Bin 62605 -> 62590 bytes docs/reference/eda_dens-2.png | Bin 62613 -> 62610 bytes docs/reference/eda_dens.html | 4 ++-- docs/reference/eda_lm-1.png | Bin 69705 -> 69108 bytes docs/reference/eda_lm-2.png | Bin 76193 -> 76148 bytes docs/reference/eda_lm-3.png | Bin 64618 -> 64797 bytes docs/reference/eda_lm-4.png | Bin 219207 -> 219848 bytes docs/reference/eda_lm-5.png | Bin 217062 -> 217528 bytes docs/reference/eda_lm-6.png | Bin 240881 -> 240848 bytes docs/reference/eda_lm.html | 4 ++-- docs/reference/eda_lsum.html | 4 ++-- docs/reference/eda_pol.html | 4 ++-- docs/reference/eda_qq-1.png | Bin 54875 -> 54746 bytes docs/reference/eda_qq-2.png | Bin 55153 -> 54693 bytes docs/reference/eda_qq-3.png | Bin 55331 -> 55962 bytes docs/reference/eda_qq-4.png | Bin 52537 -> 52857 bytes docs/reference/eda_qq-5.png | Bin 52110 -> 52484 bytes docs/reference/eda_qq-6.png | Bin 46892 -> 47382 bytes docs/reference/eda_qq-7.png | Bin 48767 -> 48968 bytes docs/reference/eda_qq-8.png | Bin 52068 -> 53396 bytes docs/reference/eda_qq-9.png | Bin 60343 -> 59995 bytes docs/reference/eda_qq.html | 4 ++-- docs/reference/eda_re.html | 4 ++-- docs/reference/eda_rline-1.png | Bin 68842 -> 70051 bytes docs/reference/eda_rline-2.png | Bin 44418 -> 45855 bytes docs/reference/eda_rline-3.png | Bin 77797 -> 78422 bytes docs/reference/eda_rline-4.png | Bin 41182 -> 42230 bytes docs/reference/eda_rline.html | 4 ++-- docs/reference/eda_sl-1.png | Bin 23397 -> 23490 bytes docs/reference/eda_sl.html | 4 ++-- docs/reference/eda_trim.html | 4 ++-- docs/reference/eda_unipow.html | 4 ++-- docs/reference/index.html | 4 ++-- docs/reference/neoplasms.html | 4 ++-- docs/reference/nine_point.html | 4 ++-- docs/reference/plot.eda_polish-3.png | Bin 44565 -> 44294 bytes docs/reference/plot.eda_polish.html | 4 ++-- docs/reference/plot.eda_rline-1.png | Bin 67192 -> 67671 bytes docs/reference/plot.eda_rline-2.png | Bin 65111 -> 65435 bytes docs/reference/plot.eda_rline.html | 4 ++-- docs/reference/tukeyedar.html | 4 ++-- docs/reference/wat05.html | 4 ++-- docs/reference/wat95.html | 4 ++-- docs/search.json | 2 +- man/eda_bipow.Rd | 11 +++++++++-- man/eda_normfit.Rd | 2 +- 93 files changed, 138 insertions(+), 103 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5d6a10a..10f0310 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: tukeyedar -Version: 0.1.1.9000 +Version: 0.2.0 Type: Package Title: Tukey Inspired Exploratory Data Analysis Functions Authors@R: person(given = "Manuel", diff --git a/NEWS.md b/NEWS.md index 335eb8f..5731cc2 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# tukeyedar (development version) +# tukeyedar 0.2.0 * Added a Normal QQ plot option to `eda_qq` * Added symmetrical Normal fit plot function `eda_normfit` * Updated eda_boxls aesthetics diff --git a/R/eda_3pt.R b/R/eda_3pt.R index 66e8f9f..d5bd8bb 100755 --- a/R/eda_3pt.R +++ b/R/eda_3pt.R @@ -134,12 +134,13 @@ eda_3pt <- function(dat, x, y, px = 1, py = 1, tukey = TRUE, axes = TRUE, pdf(NULL) plot(x = x, y = y, type = "n", xlab = "", ylab = "", xaxt = "n", yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) + # y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 # Set plot parameters diff --git a/R/eda_bipow.R b/R/eda_bipow.R index ad5cb24..b77e909 100755 --- a/R/eda_bipow.R +++ b/R/eda_bipow.R @@ -30,9 +30,16 @@ #' #' @examples #' -#' eda_bipow(dat = cars, x = speed, y = dist) +#' data(cars) +#' # Example 1 +#' eda_bipow(dat = cars, x = speed, y = dist) +#' # Custom powers +#' eda_bipow(dat = cars, x = speed, y = dist, p = c(-1, -0.5, 0, 0.5, 1)) +#' # Adopt box-cox transformation +#' eda_bipow(dat = cars, x = speed, y = dist, tukey = FALSE, p = c(-1, -0.5, 0, 0.5, 1)) +#' -eda_bipow <- function(dat, x, y, p = c(3, 2, 1, .5, 0), tukey=TRUE, ...) { +eda_bipow <- function(dat, x, y, p = c(-1, 0, 0.5, 1, 2), tukey=TRUE, ...) { if(!missing(dat)) { @@ -48,10 +55,11 @@ eda_bipow <- function(dat, x, y, p = c(3, 2, 1, .5, 0), tukey=TRUE, ...) { # Plot data for each transformation M <- matrix( 1: ((nRows + 2)*(nCols + 2)),nrow=nRows + 2, ncol = nCols + 2, byrow=TRUE) - .pardef <- par(no.readonly = T) - on.exit(par(.pardef), add = TRUE) + .pardef <- par(mar = c(0,0,0,0)) +# on.exit(par(.pardef), add = TRUE) + on.exit(par(.pardef)) - par(mar = c(0,0,0,0)) + # par(mar = c(0,0,0,0)) lHeight <- c(0.3, rep(1, nCols),0.3 ) lWidth <- c(0.3, rep(1, nCols),0.3 ) layout(mat=M, widths = lWidth , heights= lHeight) diff --git a/R/eda_boxls.R b/R/eda_boxls.R index 85317be..9fc7d96 100755 --- a/R/eda_boxls.R +++ b/R/eda_boxls.R @@ -173,14 +173,17 @@ eda_boxls <- function(dat, x, fac, p = 1, tukey = FALSE, outlier=TRUE, fac.min <- which.min(nchar(fac.names)) fac.max <- which.max(nchar(fac.names)) y.labs <- c(fac.names[fac.min], fac.names[fac.max]) + y.wid <- max(strwidth( y.labs[1], units="inches"), + strwidth( y.labs[2], units="inches")) * in2line + 1.2 } else { - y.labs <- range(axTicks(2)) + # y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 } dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1.2 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1.2 # .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3.2,1)) diff --git a/R/eda_dens.R b/R/eda_dens.R index dc7d370..27f03fd 100755 --- a/R/eda_dens.R +++ b/R/eda_dens.R @@ -128,12 +128,13 @@ eda_dens <- function(x, y, fac = NULL, p = 1L, tukey = FALSE, fx = NULL, pdf(NULL) plot(x = dx, y = NULL, type = "n", xlab = "", ylab = "", xaxt = "n", yaxt='n', main = NULL, xlim = xlim, ylim = ylim) - y.labs <- range(axTicks(2)) + # y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 # Plot data .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3,1)) diff --git a/R/eda_lm.R b/R/eda_lm.R index c60c576..e162063 100755 --- a/R/eda_lm.R +++ b/R/eda_lm.R @@ -168,12 +168,13 @@ eda_lm <- function(dat, x, y, xlab = NULL, ylab = NULL, px = 1, py = 1, pdf(NULL) plot(x = x, y = y, type = "n", xlab = "", ylab = "", xaxt = "n", yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) + #y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3,1)) on.exit(par(.pardef)) diff --git a/R/eda_normfit.R b/R/eda_normfit.R index b4bba8a..4f8616b 100644 --- a/R/eda_normfit.R +++ b/R/eda_normfit.R @@ -181,12 +181,13 @@ eda_normfit <- function(dat, x=NULL, grp=NULL, p = 1, tukey = FALSE, plot(x = NULL, y = NULL, type = "n", xlab = "", ylab = "", xaxt = "n", xlim=c(1 - 0.4, length(grp_unique) + 0.4), ylim = dx_rng, yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) +# y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 # Set plot parameters .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3.2,1)) diff --git a/R/eda_qq.R b/R/eda_qq.R index 7793478..63d09ef 100755 --- a/R/eda_qq.R +++ b/R/eda_qq.R @@ -260,12 +260,13 @@ eda_qq <- function(x, y=NULL, fac = NULL, norm = FALSE, p = 1L, tukey = FALSE, pdf(NULL) plot(x = x, y = y, type = "n", xlab = "", ylab = "", xaxt = "n", yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) +# y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 # Set plot parameters .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3,1)) diff --git a/R/eda_sl.R b/R/eda_sl.R index 87225bb..6036a46 100755 --- a/R/eda_sl.R +++ b/R/eda_sl.R @@ -110,12 +110,13 @@ eda_sl <- function(dat, x, fac, p = 1, tukey = FALSE, sprd = "frth", pdf(NULL) plot(x = level, y = spread, type = "n", xlab = "", ylab = "", xaxt = "n", yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) + # y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3,1)) on.exit(par(.pardef)) diff --git a/R/plot.eda_polish.R b/R/plot.eda_polish.R index 2fdf1cc..41a62b5 100755 --- a/R/plot.eda_polish.R +++ b/R/plot.eda_polish.R @@ -96,13 +96,14 @@ plot.eda_polish <- function(x, type = "residuals", add.cv = FALSE, k = NULL, # Create a dummy plot to extract y-axis labels pdf(NULL) plot(x = cv, y = residuals, type = "n", xlab = "", ylab = "", xaxt = "n", - yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) + yaxt='n', main = NULL) + # y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 # Set plot parameters .pardef <- par(pty = "s", col = plotcol, mar = c(3,y.wid,3,1)) diff --git a/R/plot.eda_rline.R b/R/plot.eda_rline.R index 32adfa6..b27fea7 100755 --- a/R/plot.eda_rline.R +++ b/R/plot.eda_rline.R @@ -74,12 +74,13 @@ plot.eda_rline <- function(x, type = "model", xlab = NULL, ylab = NULL, grey = 0 pdf(NULL) plot(x = x$x, y = x$y, type = "n", xlab = "", ylab = "", xaxt = "n", yaxt='n', main = NULL) - y.labs <- range(axTicks(2)) + # y.labs <- range(axTicks(2)) + y.wid <- max( strwidth( axTicks(2), units="inches")) * in2line + 1.2 dev.off() # Compute the margin width (returned in inches before converting to lines) - y.wid <- max( strwidth( y.labs[1], units="inches"), - strwidth( y.labs[2], units="inches")) * in2line + 1 + # y.wid <- max( strwidth( y.labs[1], units="inches"), + # strwidth( y.labs[2], units="inches")) * in2line + 1 # Set plot parameters if(equal == TRUE ){ diff --git a/docs/404.html b/docs/404.html index 9d2fdac..17eeb29 100755 --- a/docs/404.html +++ b/docs/404.html @@ -24,7 +24,7 @@ tukeyedar - 0.1.1.9000 + 0.2.0