Skip to content

Commit

Permalink
a few more edits
Browse files Browse the repository at this point in the history
  • Loading branch information
mgimond committed Dec 29, 2023
1 parent b7662ce commit 6acc218
Show file tree
Hide file tree
Showing 93 changed files with 138 additions and 103 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions R/eda_3pt.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions R/eda_bipow.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions R/eda_boxls.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions R/eda_dens.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions R/eda_lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions R/eda_normfit.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions R/eda_qq.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions R/eda_sl.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 5 additions & 4 deletions R/plot.eda_polish.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 4 additions & 3 deletions R/plot.eda_rline.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 ){
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

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

12 changes: 6 additions & 6 deletions docs/articles/RLine.html

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

Binary file modified docs/articles/RLine_files/figure-html/unnamed-chunk-22-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/RLine_files/figure-html/unnamed-chunk-25-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/articles/index.html

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

2 changes: 1 addition & 1 deletion docs/articles/polish.html

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

2 changes: 1 addition & 1 deletion docs/articles/qq.html

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

2 changes: 1 addition & 1 deletion docs/authors.html

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

2 changes: 1 addition & 1 deletion docs/index.html

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

4 changes: 2 additions & 2 deletions docs/news/index.html

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

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ articles:
polish: polish.html
qq: qq.html
RLine: RLine.html
last_built: 2023-12-28T22:13Z
last_built: 2023-12-28T23:01Z
urls:
reference: https://mgimond.github.io/tukeyedar/reference
article: https://mgimond.github.io/tukeyedar/articles
Expand Down
Binary file modified docs/reference/Rplot001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Rplot009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/reference/age_height.html

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

Binary file modified docs/reference/eda_3pt-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/eda_3pt-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/reference/eda_3pt.html

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

Binary file modified docs/reference/eda_add-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6acc218

Please sign in to comment.