Skip to contents

The function dropCosts removes all edge weights (costs) from a gGraph object, returning an unweighted graph.

Usage

dropCosts(x, ...)

# S4 method for class 'gGraph'
dropCosts(x)

Arguments

x

a valid gGraph object.

...

additional arguments passed to other methods (currently unused).

Value

A gGraph object with all edge costs removed.

Functions

  • dropCosts(gGraph): Method for gGraph objects

See also

getCosts to retrieve edge costs, setCosts to set edge costs. hasCosts to check if a graph has costs defined.

Other cost_functions: combineCosts(), getCosts(), hasCosts(), setCosts(), setDistCosts()

Examples

hasCosts(rawgraph.10k)
#> [1] TRUE
x <- dropCosts(worldgraph.10k)
hasCosts(x)
#> [1] FALSE