CRAN Package Check Results for Package gaoptim

Last updated on 2018-06-17 19:49:41 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.1 1.14 23.83 24.97 ERROR
r-devel-linux-x86_64-debian-gcc 1.1 0.86 18.08 18.94 ERROR
r-devel-linux-x86_64-fedora-clang 1.1 34.69 NOTE
r-devel-linux-x86_64-fedora-gcc 1.1 32.58 NOTE
r-devel-windows-ix86+x86_64 1.1 3.00 46.00 49.00 NOTE
r-patched-linux-x86_64 1.1 0.92 22.13 23.05 ERROR
r-patched-solaris-x86 1.1 48.10 NOTE
r-release-linux-x86_64 1.1 1.09 22.09 23.18 ERROR
r-release-windows-ix86+x86_64 1.1 4.00 35.00 39.00 NOTE
r-release-osx-x86_64 1.1 NOTE
r-oldrel-windows-ix86+x86_64 1.1 2.00 32.00 34.00 NOTE
r-oldrel-osx-x86_64 1.1 NOTE

Check Details

Version: 1.1
Check: S3 generic/method consistency
Result: NOTE
    Found the following apparent S3 methods exported but not registered:
     plot.GAPerm plot.GAReal print.GAPerm print.GAReal print.summaryGAPerm
     print.summaryGAReal summary.GAPerm summary.GAReal
    See section ‘Registering S3 methods’ in the ‘Writing R Extensions’
    manual.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64

Version: 1.1
Check: R code for possible problems
Result: NOTE
    GAPerm : pmxCrossover: no visible global function definition for
     ‘runif’
    GAReal : twoPointsCrossover: no visible global function definition for
     ‘runif’
    GAReal : blendCrossover: no visible global function definition for
     ‘runif’
    GAReal : mutateNoise: no visible global function definition for ‘runif’
    GAReal : initPopulation: no visible global function definition for
     ‘runif’
    plot.GAPerm: no visible global function definition for ‘plot’
    plot.GAPerm: no visible global function definition for ‘grid’
    plot.GAPerm: no visible global function definition for ‘lines’
    plot.GAPerm: no visible global function definition for ‘legend’
    plot.GAReal: no visible global function definition for ‘plot’
    plot.GAReal: no visible global function definition for ‘grid’
    plot.GAReal: no visible global function definition for ‘lines’
    plot.GAReal: no visible global function definition for ‘legend’
    Undefined global functions or variables:
     grid legend lines plot runif
    Consider adding
     importFrom("graphics", "grid", "legend", "lines", "plot")
     importFrom("stats", "runif")
    to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 1.1
Check: Rd line widths
Result: NOTE
    Rd file 'plot_perm.Rd':
     \usage lines wider than 90 characters:
     legend.pos = c("bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", "center"),
    
    Rd file 'plot_real.Rd':
     \usage lines wider than 90 characters:
     legend.pos = c("bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", "center"),
    
    These lines will be truncated in the PDF manual.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-release-linux-x86_64

Version: 1.1
Check: examples
Result: ERROR
    Running examples in ‘gaoptim-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: GAPerm
    > ### Title: Genetic Algorithm setup
    > ### Aliases: GAPerm
    >
    > ### ** Examples
    >
    > # TSP with 10 cities around a circular pattern
    > n = 10
    > R = 10
    > angs = seq(0, 2*pi, length = n)
    > xp = R * cos(angs) + rnorm(n)
    > yp = R * sin(angs) + rnorm(n)
    > xp = c(xp, xp[1])
    > yp = c(yp, yp[1])
    >
    > base.M = matrix(c(xp, yp), ncol = 2)
    > dist.FUN = function(p)
    + {
    + p = c(p, p[1])
    + M.diff = diff(base.M[p, ])
    + dists = apply(M.diff, 1, function(x)x[1]^2 + x[2]^2)
    + 1/sum(dists)
    + }
    >
    > ga1 = GAPerm(dist.FUN, n, popSize = 100, mutRate = 0.3)
    > ga1$evolve(100)
    > plot(xp, yp, type = 'n', xlab = '', ylab = '')
    > res = ga1$bestIndividual()
    > res = c(res, res[1])
    >
    > i = 1:n
    > xi = base.M[res[i], 1]
    > yi = base.M[res[i], 2]
    > xf = base.M[res[i + 1], 1]
    > yf = base.M[res[i + 1], 2]
    >
    > arrows(xi, yi, xf, yf, col = 'red', angle = 10)
    > text(base.M[res, 1], base.M[res, 2], 1:n, cex = 0.9, col = 'gray20')
    >
    >
    > # Euro tour problem (See ?optim)
    > eurodistmat = as.matrix(eurodist)
    >
    > # This function will be used for the remaining examples
    > distance = function(sq)
    + {
    + sq = c(sq, sq[1])
    + sq2 <- embed(sq, 2)
    + 1/sum(eurodistmat[cbind(sq2[,2], sq2[,1])])
    + }
    >
    > loc = -cmdscale(eurodist, add = TRUE)$points
    > x = loc[, 1]
    > y = loc[, 2]
    > n = nrow(eurodistmat)
    >
    > set.seed(1)
    > ga2 = GAPerm(distance, n, popSize = 100, mutRate = 0.3)
    > ga2$evolve(200)
    > best = ga2$bestIndividual()
    > best = c(best, best[1])
    > best.dist = 1/max(ga2$bestFit())
    > res = loc[best, ]
    > i = 1:n
    >
    > plot(x, y, type = 'n', axes = FALSE, ylab = '', xlab = '')
    > title ('Euro tour: TSP with 21 cities')
    > mtext(paste('Best distance found:', best.dist))
    > arrows(res[i, 1], res[i, 2], res[i + 1, 1], res[i + 1, 2], col = 'red', angle = 10)
    > text(x, y, labels(eurodist), cex = 0.8, col = 'gray20')
    >
    >
    > # Euro tour with custom selection
    > selec.FUN = function(population, fitnessVec, nLeft)
    + {
    + # Chance of being select proportional to fitness sqrt
    + idxs = sample(nrow(population), nLeft, prob = sqrt(fitnessVec))
    +
    + # Just return the nLeft selected row indexes
    + idxs
    + }
    >
    > ga3 = GAPerm(distance, n, mutRate = 0.3, selection = selec.FUN)
    > ga3$evolve(200)
    > best.dist = 1/max(ga3$bestFit())
    > plot(ga3, main = 'Euro tour: TSP with 21 cities')
    Error in xy.coords(x, y, xlabel, ylabel, log) :
     'x' is a list, but does not have components 'x' and 'y'
    Calls: plot -> plot.default -> xy.coords
    Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-patched-linux-x86_64, r-release-linux-x86_64