Skip to contents

Classes

Classes included in the package.

gGraph-class gGraph
Formal class "gGraph"
gData-class gData
Formal class "gData"
gPath-class gPath
Formal class "gPath"

Graph construction

Functions for creating new custom gGraph objects.

makeHexGrid()
Make a new gGraph object from a custom hexagonal grid
makeSquareGrid()
Make a new gGraph object from a custom square grid

Graph modification

Functions for modifying gGraph objects.

assignByRaster()
Assign raster values to graph nodes
assignByPolygon()
Assign node attributes from a polygon layer
setEdges()
Add and remove edges from a gGraph object
setNodesAttr()
Set node attributes in a gGraph object

Graph modification (interactive)

Functions for interactively modifying gGraph objects.

geo.add.edges()
Add and remove edges from a gGraph object
geo.change.attr()
Change values of a node attribute

Accessors

Functions for accessing slots of a gGraph or gData object.

getColors()
Get colors associated to nodes of a gGraph object
getCoords()
Get coordinates of nodes in a gGraph or gData object
getCosts() getNodeCosts()
Get costs associated to edges of a gGraph object
getData()
Get the data component of a gData object
getEdges()
Get edges from a gGraph object
getGraph()
Get the graph component of a gGraph or gData object
getNodes()
Get nodes of a gGraph or gData object
getNodesAttr()
Get nodes attributes from gGraph/gData object
setColors()
Set color rules for a gGraph object
setGraph()
Set the linked gGraph for a gData object

Connectivity functions

Functions for finding nodes and querying spatial relationships.

areConnected()
Test if a set of nodes form a connected set
areNeighbours()
Tests connectivity between pairs of nodes
isConnected(<gData>) isConnected(<gGraph>)
Test if a set of nodes form a connected set
isReachable()
Tests if location reachable from nodes
closestNode()
Find the closest node to a given location
isInArea()
Find which nodes fall in a given area
findLand()
Find which nodes are on land
dropDeadEdges()
Get rid of some 'dead' edges or nodes
keepMaxConnectedSet()
Keep only the largest connected set

Costs

Functions adjusting the costs of a gGraph object.

combineCosts()
Combine the costs of two gGraph objects
dropCosts()
Remove all costs from a gGraph object
getCosts() getNodeCosts()
Get costs associated to edges of a gGraph object
hasCosts()
Check if a gGraph has costs
setCosts()
Set friction in a gGraph object
setDistCosts()
Set costs associated to edges based on geographic distances

Shortest paths

Functions for computing shortest paths and distances.

dijkstraBetween()
Find the shortest path between nodes in a graph
dijkstraBuffer()
Find nodes reachable within a cost threshold
dijkstraFrom()
Find the minimum cost path
gPath2dist()
Extract distances from a gPath object
polygonBetween()
Least-cost paths between two polygons
buffer(<gGraph>) buffer(<gData>)
Compute buffers around locations for gGraph and gData objects

Basic plotting

Basic functions for visualising gGraph and gData objects.

plot(<gData>,<missing>) points(<gData>)
Plot a gData object.
plot(<gGraph>,<missing>) points(<gGraph>) plotEdges()
Plot a gGraph object.
plot(<gPath>) print(<gPath>)
Plot a gPath object
connectivityPlot()
Plot connected sets of a gGraph object
geo.segments()
Plot segments correctly when crossing the antimeridian
zoom geo.zoomin geo.zoomout geo.slide geo.back geo.bookmark geo.goto .zoomlog.up
Navigate in the plot of a gGraph object

Advanced plotting

Plotting functions based on ggplot2.

autoplot(<gData>)
Default ggplot for a gData
autoplot(<gGraph>)
Default ggplot for a gGraph
geom_gdata()
ggplot layer for a gData
geom_ggraph()
ggplot layer for a gGraph
geom_gpath()
ggplot layer for a gPath

Example data

Datasets included in the package.

hgdp hgdpPlus
Human genome diversity panel - georeferenced data
worldgraph rawgraph.10k rawgraph.40k worldgraph.10k worldgraph.40k
Worldwide geographic graphs
fst_hgdp
Pairwise FST matrix for HGDP populations

Basic Methods

Basic methods to subset and show gGraph and gData objects