Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MLopez-Ibanez committed Dec 3, 2023
1 parent afb85a1 commit 84be34a
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ jobs:
output-dir: wheelhouse

- uses: actions/upload-artifact@v3
if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')"
with:
name: wheels
path: wheelhouse/*.whl
1 change: 1 addition & 0 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

export(attsurf2df)
export(avg_hausdorff_dist)
export(choose_eafdiff)
export(eafdiff)
export(eafs)
export(epsilon_additive)
Expand Down
32 changes: 31 additions & 1 deletion r/R/interactive.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,44 @@ largest_eafdiff <- function(x, maximise = FALSE, intervals = 5L, reference,
list(pair=best_pair, value = best_value)
}


#' Interactively choose according to empirical attainment function differences
#'
#' @param x (`matrix()`) Matrix of rectangles representing EAF differences
#' (returned by [eafdiff()] with `rectangles=TRUE`).
#'
#' @param left (`logical(1)`) With `left=TRUE` return the rectangles with
#' positive differences, otherwise return those with negative differences but
#' differences are converted to positive.
#'
#' @return `matrix` where the first 4 columns give the coordinates of two
#' corners of each rectangle and the last column. In both cases, the last
#' column gives the positive differences in favor of the chosen side.
#'
#' @examples
#' \donttest{
#' extdata_dir <- system.file(package="moocore", "extdata")
#' A1 <- read_datasets(file.path(extdata_dir, "wrots_l100w10_dat"))
#' A2 <- read_datasets(file.path(extdata_dir, "wrots_l10w100_dat"))
#' # Choose A1
#' rectangles <- eafdiff(A1, A2, intervals = 5, rectangles = TRUE)
#' rectangles <- choose_eafdiff(rectangles, left = TRUE)
#' reference <- c(max(A1[, 1], A2[, 1]), max(A1[, 2], A2[, 2]))
#' x <- split.data.frame(A1[,1:2], A1[,3])
#' hv_A1 <- sapply(split.data.frame(A1[, 1:2], A1[, 3]),
#' hypervolume, reference=reference)
#' hv_A2 <- sapply(split.data.frame(A2[, 1:2], A2[, 3]),
#' hypervolume, reference=reference)
#' print(fivenum(hv_A1))
#' print(fivenum(hv_A2))

#' whv_A1 <- sapply(split.data.frame(A1[, 1:2], A1[, 3]),
#' whv_rect, rectangles=rectangles, reference=reference)
#' whv_A2 <- sapply(split.data.frame(A2[, 1:2], A2[, 3]),
#' whv_rect, rectangles=rectangles, reference=reference)
#' print(fivenum(whv_A1))
#' print(fivenum(whv_A2))
#' }
#'
#'@concept eaf
#'@export
choose_eafdiff <- function(x, left = stop("'left' must be either TRUE or FALSE"))
Expand Down
1 change: 1 addition & 0 deletions r/inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ TPLS
TR
Tabu
TabuCol
Vanzyl
Vanzyl's
Vorob'ev
behavior
Expand Down
50 changes: 50 additions & 0 deletions r/man/choose_eafdiff.Rd

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

0 comments on commit 84be34a

Please sign in to comment.