From 97ecb53edca379a6f0d58da96d2947f53ce36cc4 Mon Sep 17 00:00:00 2001
From: dramanica InstallationGitHub with:
install.packages("devtools")
-devtools::install_github("thibautjombart/geoGraph")
rebuild
: in development.
Thibaut Jombart (t.jombart@imperial.ac.uk)
-Thibaut Jombart (t.jombart@imperial.ac.uk)
-geo.add.edges
and geo.remove.edges
to
interactively add or remove edges in a gGraph object.
Thibaut Jombart (t.jombart@imperial.ac.uk)
-data("worldgraph.40k")
# new graph with custom cost function
exp.cost <- function(x1, x2, cost.coeff) {
- exp(-abs(x1 - x2) * cost.coeff)
+ exp(-abs(x1 - x2) * cost.coeff)
}
# create a set of node costs
-worldgraph.40k@nodes.attr$meanProd<-runif(n=40962)
+worldgraph.40k@nodes.attr$meanProd <- runif(n = 40962)
new_costs_graph <-
setCosts(
worldgraph.40k,
@@ -128,7 +128,7 @@ Examples cost.coeff = 0.5
)
# combine costs from the original graph with the new costs
-combine_costs_graph<- combineCosts(worldgraph.40k, new_costs_graph, method="sum")
+combine_costs_graph <- combineCosts(worldgraph.40k, new_costs_graph, method = "sum")