R/bestnet.R

Defines functions bestnet

Documented in bestnet

bestnet <- function(optimnet){
	if(!inherits(optimnet, 'rbga')) stop(paste("object must be of class rbga"))
	j <- which.min(optimnet$evaluations)
	a <- optimnet$population[j,]
	n <- dim(optimnet$population)[2]/2
	b <- cbind(a[1:n],a[(n+1):(2*n)])
	p.c <- as.data.frame(round(b, 1))
	names(p.c) <- c("x", "y")
	coordinates(p.c) = c("x", "y")
	p.c
}

Try the geospt package in your browser

Any scripts or data that you put into this service are public.

geospt documentation built on Oct. 11, 2023, 1:07 a.m.