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)