diff --git a/DESCRIPTION b/DESCRIPTION index a116fb1..61bb2a3 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,5 +25,5 @@ Suggests: rmarkdown, testthat (>= 3.0.0) VignetteBuilder: knitr -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1.9000 Config/testthat/edition: 3 diff --git a/R/eda_dens.R b/R/eda_dens.R index 27f03fd..4a02d67 100755 --- a/R/eda_dens.R +++ b/R/eda_dens.R @@ -17,6 +17,8 @@ #' transformation is applied to the x variable. #' @param fy Formula to apply to y variable. This is computed after any #' transformation is applied to the y variable. +#' @param show.par Boolean determining if parameters such as power +#' transformation or formula should be displayed. #' @param grey Grey level to apply to plot elements (0 to 1 with 1 = black). #' @param col Fill color for second density distribution. #' @param size Point size (0-1). @@ -49,7 +51,7 @@ eda_dens <- function(x, y, fac = NULL, p = 1L, tukey = FALSE, fx = NULL, - fy = NULL, grey = 0.6, col = "red", size = 0.8, + fy = NULL, show.par = TRUE, grey = 0.6, col = "red", size = 0.8, alpha = 0.4, xlab = NULL, ylab = NULL, legend = TRUE, ...) { # Extract data @@ -151,7 +153,10 @@ eda_dens <- function(x, y, fac = NULL, p = 1L, tukey = FALSE, fx = NULL, tck = -0.02) mtext("Density", side=3, adj= -0.1 , col=plotcol, padj = -1) title(xlab = "Value", line = 1.8, col.lab=plotcol) - mtext(side = 3, text=paste0("p=",p,";",fx," ",fy,sep=""), adj=1, cex = 0.65) + if(show.par == TRUE){ + mtext(side = 3, text=paste0("p=",p,";",fx," ",fy,sep=""), adj=1, cex = 0.65) + } + if (legend == TRUE){ sq <- par("usr") # get plot corners diff --git a/R/eda_qq.R b/R/eda_qq.R index 63d09ef..172d26d 100755 --- a/R/eda_qq.R +++ b/R/eda_qq.R @@ -347,11 +347,11 @@ eda_qq <- function(x, y=NULL, fac = NULL, norm = FALSE, p = 1L, tukey = FALSE, } # Add power/formula parameters to plot - if(norm != TRUE){ + if(norm != TRUE & show.par == TRUE){ params <- gsub(";\\s*;?\\s*$", "", paste0("p=", p,"; ",fx,"; ",fy)) params <- gsub("\\; \\;", ";", params) mtext(side = 3, text=params, adj=1, cex = 0.65) - } else { + } else if (norm == TRUE & show.par == TRUE){ mtext(side = 3, text=paste0("p=",p), adj=1, cex = 0.65) } diff --git a/R/tukeyedar-package.R b/R/tukeyedar-package.R new file mode 100644 index 0000000..a65cf64 --- /dev/null +++ b/R/tukeyedar-package.R @@ -0,0 +1,6 @@ +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/R/tukeyedar.R b/R/tukeyedar.R index bc5cae0..452b58f 100644 --- a/R/tukeyedar.R +++ b/R/tukeyedar.R @@ -3,6 +3,5 @@ #' @description This packages hosts a small set of Tukey inspired functions for use #' in exploring datasets in a robust manner. #' -#' @docType package #' @name tukeyedar NULL diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png index 1299382..17a3580 100755 Binary files a/docs/reference/Rplot001.png and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/eda_dens-1.png b/docs/reference/eda_dens-1.png index 5cb0d9e..9d8759d 100755 Binary files a/docs/reference/eda_dens-1.png and b/docs/reference/eda_dens-1.png differ diff --git a/docs/reference/eda_dens-2.png b/docs/reference/eda_dens-2.png index d4d71bc..612925c 100755 Binary files a/docs/reference/eda_dens-2.png and b/docs/reference/eda_dens-2.png differ diff --git a/docs/reference/eda_dens.html b/docs/reference/eda_dens.html index 702fd55..daf40a9 100755 --- a/docs/reference/eda_dens.html +++ b/docs/reference/eda_dens.html @@ -70,6 +70,7 @@

Usage tukey = FALSE, fx = NULL, fy = NULL, + show.par = TRUE, grey = 0.6, col = "red", size = 0.8, @@ -115,6 +116,11 @@

ArgumentsExamples x <- rbeta(1000,2,8) y <- x * 1.5 + 0.1 eda_dens(x, y) - # Passing data as a dataframe dat <- data.frame(val = c(x, y), grp = c(rep("x", length(x)), rep("y", length(y)))) + eda_dens(dat, val, grp) @@ -187,7 +193,7 @@

Examples -

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.7.9000.

diff --git a/docs/reference/index.html b/docs/reference/index.html index 79de396..c2071f3 100755 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -186,7 +186,7 @@

All functions -

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.0.7.9000.

diff --git a/man/eda_dens.Rd b/man/eda_dens.Rd index 42c88f8..ee39e88 100755 --- a/man/eda_dens.Rd +++ b/man/eda_dens.Rd @@ -12,6 +12,7 @@ eda_dens( tukey = FALSE, fx = NULL, fy = NULL, + show.par = TRUE, grey = 0.6, col = "red", size = 0.8, @@ -41,6 +42,9 @@ transformation is applied to the x variable.} \item{fy}{Formula to apply to y variable. This is computed after any transformation is applied to the y variable.} +\item{show.par}{Boolean determining if parameters such as power +transformation or formula should be displayed.} + \item{grey}{Grey level to apply to plot elements (0 to 1 with 1 = black).} \item{col}{Fill color for second density distribution.} diff --git a/man/tukeyedar-package.Rd b/man/tukeyedar-package.Rd new file mode 100644 index 0000000..4c84b9b --- /dev/null +++ b/man/tukeyedar-package.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tukeyedar-package.R +\docType{package} +\name{tukeyedar-package} +\alias{tukeyedar-package} +\title{tukeyedar: Tukey Inspired Exploratory Data Analysis Functions} +\description{ +A set of Tukey inspired functions for use in exploring datasets in a robust manner. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://mgimond.github.io/tukeyedar/} + \item Report bugs at \url{https://github.com/mgimond/tukeyedar/issues/} +} + +} +\author{ +\strong{Maintainer}: Manuel Gimond \email{mgimond@gmail.com} (\href{https://orcid.org/0000-0002-3687-2316}{ORCID}) + +} +\keyword{internal} diff --git a/man/tukeyedar.Rd b/man/tukeyedar.Rd index a9bb0c0..94ad216 100755 --- a/man/tukeyedar.Rd +++ b/man/tukeyedar.Rd @@ -1,6 +1,5 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tukeyedar.R -\docType{package} \name{tukeyedar} \alias{tukeyedar} \title{Tukey inspired exploratory data analysis functions}