From 66b85292923787f801e46887053f9a43526328a6 Mon Sep 17 00:00:00 2001 From: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:05:44 +0000 Subject: [PATCH] Support spell_check --- DESCRIPTION | 11 ++++++---- Makefile | 9 ++++---- NEWS.md | 28 ++++++++++++------------ R/eaf.R | 2 +- R/eafplot.R | 14 ++++++------ R/interactive.R | 2 +- R/read_datasets.R | 2 +- cran-comments.md | 2 +- inst/WORDLIST | 46 +++++++++++++++++++++++++++++++++++++++ man/choose_eafdiffplot.Rd | 2 +- man/eafdiffplot.Rd | 2 +- man/eafplot.Rd | 6 ++--- man/eafs.Rd | 2 +- man/write_datasets.Rd | 2 +- pkgdown/_pkgdown.yml | 2 +- tests/spelling.R | 3 +++ 16 files changed, 94 insertions(+), 41 deletions(-) create mode 100644 inst/WORDLIST create mode 100644 tests/spelling.R diff --git a/DESCRIPTION b/DESCRIPTION index 16996a3..1d3efad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,10 +18,12 @@ Imports: grDevices, matrixStats, Rdpack -Suggests: extrafont, - testthat (>= 3.0.0), - withr, - viridisLite +Suggests: + extrafont, + testthat (>= 3.0.0), + withr, + viridisLite, + spelling License: GPL (>= 2) BugReports: https://github.com/MLopez-Ibanez/eaf/issues URL: https://mlopez-ibanez.github.io/eaf/, https://github.com/MLopez-Ibanez/eaf @@ -33,3 +35,4 @@ Roxygen: list(markdown = TRUE) SystemRequirements: GNU make, Gnu Scientific Library RdMacros: Rdpack Config/testthat/edition: 3 +Language: en-GB diff --git a/Makefile b/Makefile index a5e93f5..7e8bf0b 100644 --- a/Makefile +++ b/Makefile @@ -78,9 +78,9 @@ releasebuild: clean cd $(BINDIR) && R CMD build $(PACKAGEDIR) && tar -atvf $(PACKAGE)_$(PACKAGEVERSION).tar.gz releasecheck: cran + $(Reval) 'devtools::spell_check()' $(Reval) 'urlchecker::url_check()' - $(MAKE) winbuild - $(MAKE) macbuild + $(MAKE) winbuild #$(MAKE) macbuild cran : build cd $(BINDIR) && _R_CHECK_FORCE_SUGGESTS_=false _R_OPTIONS_STRINGS_AS_FACTORS_=false R CMD check --as-cran $(PACKAGE)_$(PACKAGEVERSION).tar.gz @@ -144,8 +144,9 @@ submit: remotecran: releasebuild $(Reval) "rhub::check_for_cran($(RHUB_COMMON_ARGS), show_status = TRUE)" -macbuild: releasebuild - $(Reval) "rhub::check(platform='macos-highsierra-release-cran', $(RHUB_COMMON_ARGS))" +# Stopped working +# macbuild: releasebuild +# $(Reval) "rhub::check(platform='macos-highsierra-release-cran', $(RHUB_COMMON_ARGS))" winbuild: releasebuild $(Reval) "devtools::check_win_release()" diff --git a/NEWS.md b/NEWS.md index bc8c1b1..905eed3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -123,7 +123,7 @@ # eaf 1.06 -* Fix bug when automatically generating a legend in eafplot with the +* Fix bug when automatically generating a legend in `eafplot()` with the formula interface (Thanks to Bernd Bischl for reporting this) * Improve handling of various newline character formats. @@ -132,7 +132,7 @@ * `eafdiff.pl`: Mention option `--legendpos=none` to hide the legend. -* eafplot.pl: Add options `--maximise` and `--xmaximise` and `--colors=`. +* `eafplot.pl`: Add options `--maximise` and `--xmaximise` and `--colors=`. Fix bug with `--area`. * `eafplot.default()` now requires two colors when `type=="area"` and a @@ -150,40 +150,40 @@ * Attempt to deal with DOS/Unix newlines correctly. -* eafplot.pl: Cleanups. +* `eafplot.pl`: Cleanups. (`--single, --output, --legend`): New options. Default to PDF. -* eafdiff.pl: Many cleanups. +* `eafdiff.pl`: Many cleanups. EAF diff with `type="area"` is the default now. Parameter `--cex` replaced by `--scale`. - Do not require ps2eps. - Handle `--obj1=` better. Crop pdf before converting to png. + Do not require `ps2eps`. + Handle `--obj1=` better. Crop pdf before converting to `PNG`. (`--noattsurfs`): New option. (`--output-dir,--output`): New options. (`--eps`): New option. PDF is the default now. -* Force eafdiff plots to use a square plotting region. +* Force `eafdiffplot()` to use a square plotting region. -* `read.data.sets()` normalizes paths, thus it works with files such as ~/file. +* `read.data.sets()` normalizes paths, thus it works with files such as `~/file`. * Function `eafdiffplot()` handles `percentiles=NA` and grand.lines parameter. * Fix bug with ranges and `maximise=TRUE` in `eafdiffplot()`. -* Fix points.steps to work correctly for all values of maximise. +* Fix `points.steps` to work correctly for all values of `maximise`. * Fix bug in `eafdiffplot(..., maximise=c(TRUE,FALSE), full.eaf = TRUE)` -* Fix `"log"` parameter in eafplot and eafdiffplot. +* Fix `"log"` parameter in `eafplot()` and `eafdiffplot()`. * Avoid that `eafplot.formula` modifies global options. -* Add `'axes'` parameter to eafplot. +* Add `'axes'` parameter to `eafplot()`. * To avoid confusion, the arguments `'xaxis.side'` and `'yaxis.side'` of - eafplot can only take values `c("below", "above")` and `c("left", + `eafplot()` can only take values `c("below", "above")` and `c("left", "right")`, respectively. * Add missing Makefile in `inst/scripts/eaf/`. @@ -194,10 +194,10 @@ # eaf 1.03 -* Handle maximise argument in eafdiffplot and `--maximise` command-line +* Handle maximise argument in `eafdiffplot()` and `--maximise` command-line option in `eafdiff.pl` -* R/calls.R (eafplot.data.frame): Fix problem with main parameter. +* `R/calls.R` (`eafplot.data.frame`): Fix problem with main parameter. # eaf 1.00 diff --git a/R/eaf.R b/R/eaf.R index 8144430..bccde98 100644 --- a/R/eaf.R +++ b/R/eaf.R @@ -375,7 +375,7 @@ points.steps <- function(x) #' point. If groups is not `NULL`, then an additional column #' indicates to which group the point belongs. #' -#' @author Manuel \enc{López-Ibáñez}{Lopez-Ibanez} +#' @author Manuel López-Ibáñez #' #'@note There are several examples of data sets in `system.file(package="eaf","extdata")`. The current implementation only supports two and three dimensional points. #' diff --git a/R/eafplot.R b/R/eafplot.R index 6158b38..d469cf3 100644 --- a/R/eafplot.R +++ b/R/eafplot.R @@ -4,18 +4,18 @@ #' attainment surfaces for certain percentiles or as points. #' #' This function can be used to plot random sets of points like those obtained -#' by different runs of biobjective stochastic optimization algorithms. An EAF +#' by different runs of biobjective stochastic optimisation algorithms. An EAF #' curve represents the boundary separating points that are known to be #' attainable (that is, dominated in Pareto sense) in at least a fraction #' (quantile) of the runs from those that are not. The median EAF represents #' the curve where the fraction of attainable points is 50%. In single -#' objective optimization the function can be used to plot the profile of +#' objective optimisation the function can be used to plot the profile of #' solution quality over time of a collection of runs of a stochastic optimizer. #' #' @param x Either a matrix of data values, or a data frame, or a list of #' data frames of exactly three columns. #' -#' @concept eafviz +#' @concept visualisation #' @export eafplot <- function(x, ...) UseMethod("eafplot") @@ -124,7 +124,7 @@ eafplot <- function(x, ...) UseMethod("eafplot") #' las = 1, log = "y", main = "SPEA2 (Richmond)", #' legend.pos = "bottomright") #' } -#' @concept eafviz +#' @concept visualisation #' @export eafplot.default <- function (x, sets = NULL, groups = NULL, @@ -681,7 +681,7 @@ plot.eafdiff.side <- function (eafdiff, attsurfs = list(), #' # file = "wrots_l100w10_dat-wrots_l10w100_dat-diff.txt", #' # quote = FALSE, row.names = FALSE, col.names = FALSE) #' -#' @concept eafviz +#' @concept visualisation #'@export eafdiffplot <- function(data.left, data.right, @@ -891,7 +891,7 @@ seq.intervals.labels <- function(s, first.open = FALSE, last.open = FALSE, #' #'@param data Dataframe containing the fields mentioned in the formula and in groups. #'@export -#'@concept eafviz +#'@concept visualisation eafplot.formula <- function(formula, data, groups = NULL, subset = NULL, ...) { ## formula of type time+cost~run|inst, groups=alg @@ -969,7 +969,7 @@ eafplot.formula <- function(formula, data, groups = NULL, subset = NULL, ...) #' @describeIn eafplot List interface for lists of data.frames or matrices #' #'@export -#'@concept eafviz +#'@concept visualisation eafplot.list <- function(x, ...) { if (!is.list(x)) diff --git a/R/interactive.R b/R/interactive.R index 3182bf5..6cf1fa0 100644 --- a/R/interactive.R +++ b/R/interactive.R @@ -60,7 +60,7 @@ #' #'@references #' \insertAllCited{} -#' @concept eafviz +#' @concept visualisation #' @export choose_eafdiffplot <- function(data.left, data.right, intervals = 5, maximise = c(FALSE, FALSE), diff --git a/R/read_datasets.R b/R/read_datasets.R index 6b70d75..cc6a644 100644 --- a/R/read_datasets.R +++ b/R/read_datasets.R @@ -89,7 +89,7 @@ read.data.sets <- function(file, col.names) #' @param x The data set to write. The last column must be the set number. #' #' @param file either a character string naming a file or a connection open for -#' writing. ‘""’ indicates output to the console. +#' writing. `""` indicates output to the console. #' #'@seealso \code{\link[utils]{write.table}}, [read_datasets()] #' diff --git a/cran-comments.md b/cran-comments.md index 0c6e0d4..5892fb2 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,7 +2,7 @@ Dear CRAN maintainers, I would like to submit a new version of the 'eaf' package to CRAN. -This fixes a -Wuse-after-free warning reported by Prof Brian Ripley. +This fixes several warnings reported by CRAN. Regarding this NOTE: diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..3ebff2a --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,46 @@ +Bartz +Beielstein +Biobjective +Bischl +Cleanups +Codecov +Coloring +DIMACS +EAFs +GD +GPs +Hausdorff +Hypervolume +IGD +IGDX +IRIDIA +Ibáñez +López +Metaheuristics +Mickael +Molchanov +ORCID +Preuss +Quemy +Roxygen +SPEA +TR +Tabu +TabuCol +TinyTeX +Vanzyl's +Vorob'ev +behavior +behaviors +bibtex +biobjective +cleanups +color +colormap +colors +doi +favor +hypervolume +libre +metaheuristic +nondominated diff --git a/man/choose_eafdiffplot.Rd b/man/choose_eafdiffplot.Rd index 8ccfc74..a979114 100644 --- a/man/choose_eafdiffplot.Rd +++ b/man/choose_eafdiffplot.Rd @@ -93,4 +93,4 @@ boxplot(list(A1=whv_A1, A2=whv_A2), main = "Weighted hypervolume") \code{\link[=read_datasets]{read_datasets()}}, \code{\link[=eafdiffplot]{eafdiffplot()}}, \code{\link[=whv_rect]{whv_rect()}} } \concept{eaf} -\concept{eafviz} +\concept{visualisation} diff --git a/man/eafdiffplot.Rd b/man/eafdiffplot.Rd index b2c4616..9e85eb5 100644 --- a/man/eafdiffplot.Rd +++ b/man/eafdiffplot.Rd @@ -164,4 +164,4 @@ DIFF$right[,3] <- -DIFF$right[,3] \seealso{ \code{\link[=read_datasets]{read_datasets()}} \code{\link[=eafplot]{eafplot()}} \code{\link[=pdf_crop]{pdf_crop()}} } -\concept{eafviz} +\concept{visualisation} diff --git a/man/eafplot.Rd b/man/eafplot.Rd index 0fe30b6..7928768 100644 --- a/man/eafplot.Rd +++ b/man/eafplot.Rd @@ -116,12 +116,12 @@ attainment surfaces for certain percentiles or as points. } \details{ This function can be used to plot random sets of points like those obtained -by different runs of biobjective stochastic optimization algorithms. An EAF +by different runs of biobjective stochastic optimisation algorithms. An EAF curve represents the boundary separating points that are known to be attainable (that is, dominated in Pareto sense) in at least a fraction (quantile) of the runs from those that are not. The median EAF represents the curve where the fraction of attainable points is 50\%. In single -objective optimization the function can be used to plot the profile of +objective optimisation the function can be used to plot the profile of solution quality over time of a collection of runs of a stochastic optimizer. } \section{Methods (by class)}{ @@ -189,4 +189,4 @@ eafplot (SPEA2minstoptimeRichmond, xlab = expression(C[E]), \seealso{ \code{\link[=read_datasets]{read_datasets()}} \code{\link[=eafdiffplot]{eafdiffplot()}} \code{\link[=pdf_crop]{pdf_crop()}} } -\concept{eafviz} +\concept{visualisation} diff --git a/man/eafs.Rd b/man/eafs.Rd index b4f78c3..584d57d 100644 --- a/man/eafs.Rd +++ b/man/eafs.Rd @@ -61,6 +61,6 @@ str(z) \code{\link[=read_datasets]{read_datasets()}} } \author{ -Manuel \enc{López-Ibáñez}{Lopez-Ibanez} +Manuel López-Ibáñez } \concept{eaf} diff --git a/man/write_datasets.Rd b/man/write_datasets.Rd index c98350d..d8fa076 100644 --- a/man/write_datasets.Rd +++ b/man/write_datasets.Rd @@ -10,7 +10,7 @@ write_datasets(x, file = "") \item{x}{The data set to write. The last column must be the set number.} \item{file}{either a character string naming a file or a connection open for -writing. ‘""’ indicates output to the console.} +writing. \code{""} indicates output to the console.} } \description{ Write data sets to a file in the same format as \code{\link[=read_datasets]{read_datasets()}}. diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index a96613a..f8f1834 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -25,7 +25,7 @@ reference: - has_concept("eaf") - title: Visualizing the Empirical Attainment Function contents: - - has_concept("eafviz") + - has_concept("visualisation") - symDifPlot - title: Pareto dominance contents: has_concept("dominance") diff --git a/tests/spelling.R b/tests/spelling.R new file mode 100644 index 0000000..6713838 --- /dev/null +++ b/tests/spelling.R @@ -0,0 +1,3 @@ +if(requireNamespace('spelling', quietly = TRUE)) + spelling::spell_check_test(vignettes = TRUE, error = FALSE, + skip_on_cran = TRUE)