~enricoschumann/neighbours

3e32fb514c95918c5b1cf58f71bd52196ed4302c — Enrico Schumann 1 year, 4 months ago c562de3
Add comment
3 files changed, 6 insertions(+), 2 deletions(-)

M DESCRIPTION
M NEWS
M R/neighbourfun.R
M DESCRIPTION => DESCRIPTION +1 -1
@@ 2,7 2,7 @@ Package: neighbours
Type: Package
Title: Neighbourhood Functions for Local-Search Algorithms
Version: 0.1-0
Date: 2021-09-01
Date: 2022-07-04
Maintainer: Enrico Schumann <es@enricoschumann.net>
Authors@R: person(given = "Enrico", family = "Schumann",
                  role  = c("aut", "cre"),

M NEWS => NEWS +1 -1
@@ 1,4 1,4 @@
v0.1-0  (2021-??-??)
v0.1-0  (2022-??-??)

  o Initial release.  The package provides a function
    neighbourfun() that constructs neighbourhood

M R/neighbourfun.R => R/neighbourfun.R +4 -0
@@ 16,6 16,10 @@ neighbourfun <- function(min = 0,
    budget <- sum

    .sub <- function(e, env) {
        ## replace a subexpression within e by another
        ## expression, bound in env. Example:
        ##    .sub(quote(a + b), list(a = function(x) x + 1))
        ##    ## => function(x) x + 1 + b
        expr <- substitute(substitute(e2, env),
                           env = list(e2 = e))
        eval(expr)