From 70d01201397f24f82397b661a6e4691e7aa8f6a8 Mon Sep 17 00:00:00 2001 From: Jakob Bossek Date: Tue, 14 Apr 2015 15:37:30 +0200 Subject: [PATCH] fix smoof example --- inst/examples/smoof_example.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inst/examples/smoof_example.R b/inst/examples/smoof_example.R index eaeb6e1..5b7024d 100644 --- a/inst/examples/smoof_example.R +++ b/inst/examples/smoof_example.R @@ -29,11 +29,11 @@ myMonitorStep = function(envir = parent.frame()) { df = data.frame(x = x, y = sapply(x, envir$objective.fun)) pl = ggplot(data = df, aes(x = x, y = y)) + geom_line() - # population.points = data.frame(x = as.numeric(population$individuals[[1]]), y = as.numeric(population$fitness)) - # pl = pl + geom_point(data = population.points, colour = "tomato", size = 2.2) - # pl = pl + geom_hline(yintercept = min(population$fitness), linetype = "dotted", colour = "tomato") - # print(pl) - # Sys.sleep(0.3) + population.points = data.frame(x = unlist(population$individuals), y = as.numeric(population$fitness)) + pl = pl + geom_point(data = population.points, colour = "tomato", size = 2.2) + pl = pl + geom_hline(yintercept = min(population$fitness), linetype = "dotted", colour = "tomato") + print(pl) + Sys.sleep(0.3) } myMonitor = makeMonitor(step = myMonitorStep)