Title: | Intensity Analysis of Spatial Point Patterns on Complex Networks |
---|---|
Description: | Tools to analyze point patterns in space occurring over planar network structures derived from graph-related intensity measures for undirected, directed, and mixed networks. This package is based on the following research: Eckardt and Mateu (2018) <doi:10.1080/10618600.2017.1391695>. Eckardt and Mateu (2021) <doi:10.1007/s11749-020-00720-4>. |
Authors: | Pol Llagostera [aut, cre], Matthias Eckardt [aut] |
Maintainer: | Pol Llagostera <[email protected]> |
License: | GPL-3 |
Version: | 1.4.0 |
Built: | 2024-10-30 03:45:28 UTC |
Source: | https://github.com/cran/intensitynet |
Get the intensitynet object delimited by the given window
ApplyWindow(obj, x_coords, y_coords) ## S3 method for class 'intensitynet' ApplyWindow(obj, x_coords, y_coords)
ApplyWindow(obj, x_coords, y_coords) ## S3 method for class 'intensitynet' ApplyWindow(obj, x_coords, y_coords)
obj |
intensitynet object |
x_coords |
vector containing the x coordinate limits of the window |
y_coords |
vector containing the y coordinate limits of the window |
intensitynet object delimited by the window (sub-part of the original)
data("und_intnet_chicago") sub_intnet_chicago <- ApplyWindow(und_intnet_chicago, x_coords = c(300, 900), y_coords = c(500, 1000))
data("und_intnet_chicago") sub_intnet_chicago <- ApplyWindow(und_intnet_chicago, x_coords = c(300, 900), y_coords = c(500, 1000))
Checks if events are related to the intensitynet object
AreEventsRelated(obj) ## S3 method for class 'intensitynet' AreEventsRelated(obj)
AreEventsRelated(obj) ## S3 method for class 'intensitynet' AreEventsRelated(obj)
obj |
Intensitynet object |
TRUE if related, FALSE otherwise
data("und_intnet_chicago") AreEventsRelated(und_intnet_chicago)
data("und_intnet_chicago") AreEventsRelated(und_intnet_chicago)
Calculates the distances between all pairs of nodes from the given network
## S3 method for class 'netTools' CalculateDistancesMtx(obj)
## S3 method for class 'netTools' CalculateDistancesMtx(obj)
obj |
netTools object -> list(): with the node coordinates 'x' and 'y' |
distances matrix
This data is an intensitynet object containing a directed network. The base data used is from Chicago, extracted from the spatstat package.
dir_intnet_chicago
dir_intnet_chicago
An object of class intensitynetDir
(inherits from intensitynet
) of length 6.
https://rdrr.io/cran/spatstat.data/man/chicago.html
Calculate all the edge intensities of the graph. It's more fast than using iteratively the function EdgeIntensity for all edges.
## S3 method for class 'intensitynet' EdgeIntensitiesAndProportions(obj)
## S3 method for class 'intensitynet' EdgeIntensitiesAndProportions(obj)
obj |
intensitynet object |
intensitynet class object where the graph contains all the edge intensities as an attribute
If not calculated, calculates the intensity of the edge with nodes; node_id1, node_id2. If the edge already contains an intensity, the function gives it directly without re-calculation.
## S3 method for class 'intensitynet' EdgeIntensity(obj, node_id1, node_id2)
## S3 method for class 'intensitynet' EdgeIntensity(obj, node_id1, node_id2)
obj |
intensitynet object |
node_id1 |
First node ID of the edge |
node_id2 |
Second node ID of the edge |
Intensity of the edge
This function uses internally the package 'ggplot2' to plot heatmaps of a network
## S3 method for class 'netTools' GeoreferencedGgplot2(obj, ...)
## S3 method for class 'netTools' GeoreferencedGgplot2(obj, ...)
obj |
netTools object -> list( intnet: intensitynet object, data_df: dataframe( xcoord: x coordinates of the nodes, ycoord: y coordinates of the nodes, value: vector values to plot ), net_vertices: chosen vertices to plot the heatmap (or its related edges in case to plot the edge heatmap), net_edges chosen edges to plot the heatmap, can be either the edge id's or its node endpoints (e.j. c(1,2, 2,3, 7,8)), heat_type: data which the heatmap will refer, mode: ('moran', 'getis', 'v_intensity', 'e_intensity' or mark), show_events: boolean to show or not the events as orange squares, alpha optional argument to set the transparency of the events (show_events = TRUE). The range is from 0.1 (transparent) to 1 (opaque). Default: alpha = 1 ) |
... |
extra arguments for the ggplot |
Plot the given network using its node coordinates
## S3 method for class 'netTools' GeoreferencedPlot(obj, ...)
## S3 method for class 'netTools' GeoreferencedPlot(obj, ...)
obj |
netTools object -> list( intnet: intensitynet object, vertex_labels: list of labels for the vertices, edge_labels: list of labels for the edges, xy_axes: boolean to show or not the x and y axes, enable_grid: boolean to draw or not a background grid, show_events: boolean to show or not the events as orange squares, show_events option to show the events as orange squares, FALSE by default, alpha optional argument to set the transparency of the events (show_events = TRUE). The range is from 0.1 (transparent) to 1 (opaque). Default: alpha = 1, path: vector with the nodes of the path to be highlighted. Default NULL) |
... |
extra arguments for the plot |
Gives the event correction value related to the intensitynet object
GetEventCorrection(obj) ## S3 method for class 'intensitynet' GetEventCorrection(obj)
GetEventCorrection(obj) ## S3 method for class 'intensitynet' GetEventCorrection(obj)
obj |
intensitynet object |
integer, event correction value
data("und_intnet_chicago") GetEventCorrection(und_intnet_chicago)
data("und_intnet_chicago") GetEventCorrection(und_intnet_chicago)
Returns a matrix containing the events information, i.e. coordinates and categories
GetEvents(obj) ## S3 method for class 'intensitynet' GetEvents(obj)
GetEvents(obj) ## S3 method for class 'intensitynet' GetEvents(obj)
obj |
intensitynet object |
matrix containing the event information
data("und_intnet_chicago") GetEvents(und_intnet_chicago)
data("und_intnet_chicago") GetEvents(und_intnet_chicago)
Returns the 'igraph' class network related to the intensitynet object
GetGraph(obj) ## S3 method for class 'intensitynet' GetGraph(obj)
GetGraph(obj) ## S3 method for class 'intensitynet' GetGraph(obj)
obj |
intensitynet object |
igraph class object
data("und_intnet_chicago") GetGraph(und_intnet_chicago)
data("und_intnet_chicago") GetGraph(und_intnet_chicago)
Gives the type of graph related to the intensitynet object
GetGraphType(obj) ## S3 method for class 'intensitynet' GetGraphType(obj)
GetGraphType(obj) ## S3 method for class 'intensitynet' GetGraphType(obj)
obj |
intensitynet object |
graph type in characters
data("und_intnet_chicago") GetGraphType(und_intnet_chicago)
data("und_intnet_chicago") GetGraphType(und_intnet_chicago)
Creates an igraph network with the given data
Set igraph network node coordinates as its attributes
## S3 method for class 'netTools' InitGraph(obj) ## S3 method for class 'netTools' SetNetCoords(obj)
## S3 method for class 'netTools' InitGraph(obj) ## S3 method for class 'netTools' SetNetCoords(obj)
obj |
netTools object -> list(graph: igraph, list(): with the node coordinates 'x' and 'y') |
igraph network
igraph network with the given coordinates as the attributes of the nodes
This constructor creates an intensitynet object using an adjacency matrix, the coordinates of the nodes and the coordinates of the events.
intensitynet( adjacency_mtx, node_coords, event_data, graph_type = c("undirected", "directed", "mixed"), event_correction = 5 )
intensitynet( adjacency_mtx, node_coords, event_data, graph_type = c("undirected", "directed", "mixed"), event_correction = 5 )
adjacency_mtx |
Network adjacency matrix |
node_coords |
Nodes latitude and longitude matrix (coordinates) |
event_data |
DataFrame with event latitude and longitude coordinates (mandatory columns) and optional attributes related to the events |
graph_type |
Network type: 'undirected' (default), 'directed' or 'mixed' |
event_correction |
Value that determines how far can be an event to be considered part of a segment (default 5). This value highly depends on the given coordinate system |
intensitynet class object containing: graph = <igraph>, events = <matrix>, graph_type = c('directed', 'undirected', 'mixed'), distances = <matrix>, event_correction = <integer>, events_related = <boolean>
library(spatstat) data(chicago) chicago_df <- as.data.frame(chicago[["data"]]) # Get as dataframe the data from Chicago # Get the adjacency matrix. One way is to create an igraph object from the edge coordinates. edges <- cbind(chicago[["domain"]][["from"]], chicago[["domain"]][["to"]]) chicago_net <- igraph::graph_from_edgelist(edges) # And then use the igraph function 'as_adjacency_matrix' chicago_adj_mtx <- as.matrix(igraph::as_adjacency_matrix(chicago_net)) chicago_node_coords <- data.frame(xcoord = chicago[["domain"]][["vertices"]][["x"]], ycoord = chicago[["domain"]][["vertices"]][["y"]]) # Create the intensitynet object, in this case will be undirected intnet_chicago <- intensitynet(chicago_adj_mtx, node_coords = chicago_node_coords, event_data = chicago_df)
library(spatstat) data(chicago) chicago_df <- as.data.frame(chicago[["data"]]) # Get as dataframe the data from Chicago # Get the adjacency matrix. One way is to create an igraph object from the edge coordinates. edges <- cbind(chicago[["domain"]][["from"]], chicago[["domain"]][["to"]]) chicago_net <- igraph::graph_from_edgelist(edges) # And then use the igraph function 'as_adjacency_matrix' chicago_adj_mtx <- as.matrix(igraph::as_adjacency_matrix(chicago_net)) chicago_node_coords <- data.frame(xcoord = chicago[["domain"]][["vertices"]][["x"]], ycoord = chicago[["domain"]][["vertices"]][["y"]]) # Create the intensitynet object, in this case will be undirected intnet_chicago <- intensitynet(chicago_adj_mtx, node_coords = chicago_node_coords, event_data = chicago_df)
Determine if the given object is from the class intensitynet
IsIntensitynet(obj)
IsIntensitynet(obj)
obj |
The object which will be checked if it belongs to the intensitynet class |
boolean, 'TRUE' if the argument obj is a intensitynet object
data("und_intnet_chicago") IsIntensitynet(und_intnet_chicago)
data("und_intnet_chicago") IsIntensitynet(und_intnet_chicago)
This data is an intensitynet object containing an mixed network. The base data used is from Chicago, extracted from the spatstat package.
mix_intnet_chicago
mix_intnet_chicago
An object of class intensitynetMix
(inherits from intensitynet
) of length 6.
https://rdrr.io/cran/spatstat.data/man/chicago.html
It allows to compute different dependence statistics on the network for the given vector and for neighborhoods of distinct order. Such statistics are; correlation, covariance, Moran’s I and Geary’s C.
NodeGeneralCorrelation( obj, dep_type, lag_max, intensity, partial_neighborhood = TRUE ) ## S3 method for class 'intensitynet' NodeGeneralCorrelation( obj, dep_type = c("correlation", "covariance", "moran", "geary"), lag_max, intensity, partial_neighborhood = TRUE )
NodeGeneralCorrelation( obj, dep_type, lag_max, intensity, partial_neighborhood = TRUE ) ## S3 method for class 'intensitynet' NodeGeneralCorrelation( obj, dep_type = c("correlation", "covariance", "moran", "geary"), lag_max, intensity, partial_neighborhood = TRUE )
obj |
intensitynet object |
dep_type |
'correlation', 'covariance', moran', 'geary'. The type of dependence statistic to be computed. |
lag_max |
Maximum geodesic lag at which to compute dependence |
intensity |
Vector containing the values to calculate the specified dependency in the network. Usually the node mean intensities. |
partial_neighborhood |
use partial neighborhood (TRUE) or cumulative (FALSE). TRUE by default |
A vector containing the dependence statistics (ascending from order 0).
data("und_intnet_chicago") g <- und_intnet_chicago$graph gen_corr <- NodeGeneralCorrelation(und_intnet_chicago, dep_type = 'correlation', lag_max = 2, intensity = igraph::vertex_attr(g)$intensity)
data("und_intnet_chicago") g <- und_intnet_chicago$graph gen_corr <- NodeGeneralCorrelation(und_intnet_chicago, dep_type = 'correlation', lag_max = 2, intensity = igraph::vertex_attr(g)$intensity)
Given a node, calculates its mean intensities regarding in and out edges associated with the node.
## S3 method for class 'intensitynetDir' MeanNodeIntensity(obj, node_id)
## S3 method for class 'intensitynetDir' MeanNodeIntensity(obj, node_id)
obj |
intensitynetDir object |
node_id |
ID of the node |
mean intensities of the given node for in and out edges
Given a node, calculates its mean intensities depending on the edges associated with the node, those intensities are: in, out (for directed edges), undirected and total intensity.
## S3 method for class 'intensitynetMix' MeanNodeIntensity(obj, node_id)
## S3 method for class 'intensitynetMix' MeanNodeIntensity(obj, node_id)
obj |
intensitynetMix object |
node_id |
ID of the node |
mean intensities of the given node for undirected edges, in and out directed and total intensity.
Calculates the mean intensity of the given node (intensity of all the edges of the node/number of edges of the node)
## S3 method for class 'intensitynetUnd' MeanNodeIntensity(obj, node_id)
## S3 method for class 'intensitynetUnd' MeanNodeIntensity(obj, node_id)
obj |
intensitynetUnd object |
node_id |
ID of the node |
mean intensity of the given node
Gives the node local Moran-I, Getis-Gstar or Geary-c correlations
NodeLocalCorrelation(obj, dep_type = "moran", intensity) ## S3 method for class 'intensitynet' NodeLocalCorrelation(obj, dep_type = c("moran", "getis", "geary"), intensity)
NodeLocalCorrelation(obj, dep_type = "moran", intensity) ## S3 method for class 'intensitynet' NodeLocalCorrelation(obj, dep_type = c("moran", "getis", "geary"), intensity)
obj |
intensitynet object |
dep_type |
'moran', 'getis' or 'geary'. Type of local correlation to be computed (Moran-i, Getis-Gstar, Geary-c), default = 'moran'. |
intensity |
vector containing the values to calculate the specified correlation for each node in the network. |
a vector containing two values. The first value is a vector with the specified local correlations for each node. The second values is the given intensitynet class object but with the correlations added to the node attributes of its network.
*"A Local Indicator of Multivariate SpatialAssociation: Extending Geary's c, Geographical Analysis" Luc Anselin (2018) <doi:10.1111/gean.12164>
## Not run: data("und_intnet_chicago") g <- und_intnet_chicago$graph data_moran <- NodeLocalCorrelation(und_intnet_chicago, dep_type = 'moran', intensity = igraph::vertex_attr(g)$intensity) moran_i <- data_moran$correlation intnet <- data_moran$intnet ## End(Not run)
## Not run: data("und_intnet_chicago") g <- und_intnet_chicago$graph data_moran <- NodeLocalCorrelation(und_intnet_chicago, dep_type = 'moran', intensity = igraph::vertex_attr(g)$intensity) moran_i <- data_moran$correlation intnet <- data_moran$intnet ## End(Not run)
Calculates the total weight of the given path
PathTotalWeight(obj, path_nodes, weight = NA) ## S3 method for class 'intensitynet' PathTotalWeight(obj, path_nodes, weight = NA)
PathTotalWeight(obj, path_nodes, weight = NA) ## S3 method for class 'intensitynet' PathTotalWeight(obj, path_nodes, weight = NA)
obj |
intensitynet object |
path_nodes |
vector containing the node ID's of the path |
weight |
an string specifying the type of weight to be computed. If no weight type is provided, the function will calculate the total amount of edges. Default NA. |
total weight of the path
data("und_intnet_chicago") PathTotalWeight(und_intnet_chicago, c('V115', 'V123', 'V125', 'V134'), weight = 'intensity')
data("und_intnet_chicago") PathTotalWeight(und_intnet_chicago, c('V115', 'V123', 'V125', 'V134'), weight = 'intensity')
Plot intensitynet object
## S3 method for class 'intensitynet' plot( x, vertex_labels = "none", edge_labels = "none", xy_axes = TRUE, enable_grid = FALSE, show_events = FALSE, alpha = 1, path = NULL, ... )
## S3 method for class 'intensitynet' plot( x, vertex_labels = "none", edge_labels = "none", xy_axes = TRUE, enable_grid = FALSE, show_events = FALSE, alpha = 1, path = NULL, ... )
x |
intensitynet object |
vertex_labels |
list -> labels for the vertices |
edge_labels |
list -> labels for the edges |
xy_axes |
show the x and y axes |
enable_grid |
draw a background grid |
show_events |
option to show the events as orange squares, FALSE by default |
alpha |
optional argument to set the transparency of the events (show_events = TRUE). The range is from 0.1 (transparent) to 1 (opaque). Default: alpha = 1 |
path |
vector with the nodes of the path to be highlighted. Default NULL |
... |
extra arguments for the plot |
No return value, same as graphics::plot.
data("und_intnet_chicago") plot(und_intnet_chicago) # basic plot plot(und_intnet_chicago, enable_grid = TRUE) # with grid plot(und_intnet_chicago, xy_axes = FALSE) # without axes plot(und_intnet_chicago, path = c("V1","V2","V24","V25","V26","V48")) # highlight a path
data("und_intnet_chicago") plot(und_intnet_chicago) # basic plot plot(und_intnet_chicago, enable_grid = TRUE) # with grid plot(und_intnet_chicago, xy_axes = FALSE) # without axes plot(und_intnet_chicago, path = c("V1","V2","V24","V25","V26","V48")) # highlight a path
Plot the network correlations or intensities.
PlotHeatmap( obj, heat_type = "none", intensity_type = "none", net_vertices = NULL, net_edges = NULL, show_events = FALSE, alpha = 1, ... ) ## S3 method for class 'intensitynet' PlotHeatmap( obj, heat_type = c("none", "moran", "geary", "v_intensity", "e_intensity"), intensity_type = c("none"), net_vertices = NULL, net_edges = NULL, show_events = FALSE, alpha = 1, ... )
PlotHeatmap( obj, heat_type = "none", intensity_type = "none", net_vertices = NULL, net_edges = NULL, show_events = FALSE, alpha = 1, ... ) ## S3 method for class 'intensitynet' PlotHeatmap( obj, heat_type = c("none", "moran", "geary", "v_intensity", "e_intensity"), intensity_type = c("none"), net_vertices = NULL, net_edges = NULL, show_events = FALSE, alpha = 1, ... )
obj |
intensitynet object |
heat_type |
a string with the desired heatmap to be plotted, the options are; 'moran': Local Moran-i correlation (with 999 permutations), 'geary': Local Geary-c correlation. The correlations will use the indicated intensity type, 'v_intensity': vertex mean intensity, 'e_intensity': edge intensity, mark name: name of the mark (string) to plot its edge proportion, 'none': plain map. |
intensity_type |
name of the vertex intensity used to plot the heatmap for moran, geary and v_intensity options (of the heat_type argument). The options are; For undirected networks: 'intensity'. For directed networks: 'intensity_in' or 'intensity_out'. For mixed networks: 'intensity_in', 'intensity_out', 'intensity_und' or 'intensity_all'. If the intensity parameter is 'none', the function will use, if exist, the intensity (undirected) or intensity_in (directed) values from the network nodes. If the heat_type is 'e_intensity', this parameter will be skipped and plot the edge intensities instead. |
net_vertices |
chosen vertices to plot the heatmap (or its related edges in case to plot the edge heatmap) |
net_edges |
chosen edges to plot the heatmap, can be either the edge id's or its node endpoints (e.j. c(1,2, 2,3, 7,8)) |
show_events |
option to show the events as orange squares, FALSE by default |
alpha |
optional argument to set the transparency of the events (show_events = TRUE). The range is from 0.1 (transparent) to 1 (opaque). Default: alpha = 1 |
... |
extra arguments for the class ggplot |
The plot of the heatmap with class c("gg", "ggplot")
## Not run: data("und_intnet_chicago") PlotHeatmap(und_intnet_chicago, heat_type='moran') ## End(Not run)
## Not run: data("und_intnet_chicago") PlotHeatmap(und_intnet_chicago, heat_type='moran') ## End(Not run)
Plot the net and the events in the neighborhood area of the given node
PlotNeighborhood(obj, node_id, ...) ## S3 method for class 'intensitynet' PlotNeighborhood(obj, node_id, ...)
PlotNeighborhood(obj, node_id, ...) ## S3 method for class 'intensitynet' PlotNeighborhood(obj, node_id, ...)
obj |
intensitynet object |
node_id |
Id of the node which the plot will be focused |
... |
Extra arguments for plotting |
No return value, just plots the neighborhood and the events.
data("und_intnet_chicago") PlotNeighborhood(und_intnet_chicago, node_id = 'V300')
data("und_intnet_chicago") PlotNeighborhood(und_intnet_chicago, node_id = 'V300')
Gives the distance between an event and the line (not segment) formed by two nodes.
## S3 method for class 'netTools' PointToLine(obj)
## S3 method for class 'netTools' PointToLine(obj)
obj |
netTools object -> list(p1:c(coordx, coordy), p2:c(coordx, coordy), e:c(coordx, coordy)) |
the distance to the line
Gives the shortest distance between an event and the segment formed by two nodes.
PointToSegment_deprecated(obj)
PointToSegment_deprecated(obj)
obj |
netTools object -> list(p1:c(coordx, coordy), p2:c(coordx, coordy), e:c(coordx, coordy)) |
distance to the segment
Gives the shortest distance between an event and a set of segments.
PointToSegment(obj)
PointToSegment(obj)
obj |
netTools object -> list(p1:matrix(coordx, coordy), p2:matrix(coordx, coordy), e:matrix(coordx, coordy)) |
distance vector to each segment
Calculates edgewise and mean nodewise intensities for the given intensitynet object and, for each edge, the proportions of all event covariates.
RelateEventsToNetwork(obj)
RelateEventsToNetwork(obj)
obj |
intensitynet object |
proper intensitynet object (Undirected, Directed, or Mixed) with a graph containing the nodewise intensity in the node attributes and the edgewise intensities and event covariate proportions as edge attributes.
data("und_intnet_chicago") intnet_chicago <- RelateEventsToNetwork(und_intnet_chicago)
data("und_intnet_chicago") intnet_chicago <- RelateEventsToNetwork(und_intnet_chicago)
Calculates edgewise and mean nodewise intensities for Directed networks and, for each edge, the proportions of all event covariates.
## S3 method for class 'intensitynetDir' RelateEventsToNetwork(obj)
## S3 method for class 'intensitynetDir' RelateEventsToNetwork(obj)
obj |
intensitynetDir object |
proper intensitynetDir object with a graph containing the nodewise intensity in the node attributes and the edgewise intensities and event covariate proportions as edge attributes.
Calculates edgewise and mean nodewise intensities for Mixed networks and, for each edge, the proportions of all event covariates.
## S3 method for class 'intensitynetMix' RelateEventsToNetwork(obj)
## S3 method for class 'intensitynetMix' RelateEventsToNetwork(obj)
obj |
intensitynetMix object |
proper intensitynetMix object with a graph containing the nodewise intensity in the node attributes and the edgewise intensities and event covariate proportions as edge attributes.
Calculates edgewise and mean nodewise intensities for Undirected networks and, for each edge, the proportions of all event covariates.
## S3 method for class 'intensitynetUnd' RelateEventsToNetwork(obj)
## S3 method for class 'intensitynetUnd' RelateEventsToNetwork(obj)
obj |
intensitynetUnd object |
proper intensitynetUnd object with a graph containing the nodewise intensity in the node attributes and the edgewise intensities and event covariate proportions as edge attributes.
Sets the given intensities as an edge attribute to the given igraph network
## S3 method for class 'netTools' SetEdgeIntensity(obj)
## S3 method for class 'netTools' SetEdgeIntensity(obj)
obj |
netTools object -> list(graph: igraph, node_id1: node id, node_id2: node id, intensity: edge intensity) |
igraph network with the given intensities as attributes of the edges
Set attributes to the network edges or nodes
## S3 method for class 'intensitynet' SetNetworkAttribute(obj, where, name, value)
## S3 method for class 'intensitynet' SetNetworkAttribute(obj, where, name, value)
obj |
intensitynet object |
where |
'vertex' or 'edge', where to set the attribute |
name |
name of the attribute |
value |
vector containing the data for the attribute |
intensitynet object containing the network with the added attributes
Sets the given intensities as a node attribute to the given igraph network
## S3 method for class 'netTools' SetNodeIntensity(obj)
## S3 method for class 'netTools' SetNodeIntensity(obj)
obj |
netTools object -> list(graph: igraph, node_id: node id, intensity: node intensity) |
igraph network with the given intensities as attributes of the nodes
Calculates the shortest distance path between two nodes (based on the minimum amount of edges). The function also returns the total weight of the path, if the weight is not available, returns the number of edges.
## S3 method for class 'intensitynet' ShortestNodeDistance(obj, node_id1, node_id2)
## S3 method for class 'intensitynet' ShortestNodeDistance(obj, node_id1, node_id2)
obj |
intensitynet object |
node_id1 |
id of the starting node |
node_id2 |
id of the end node |
distance of the path and the nodes of the path
Calculates the shortest path between two vertices (based on the minimum amount of edges) and calculates its total weight
ShortestPath(obj, node_id1, node_id2, weight = NA, mode = "all") ## S3 method for class 'intensitynet' ShortestPath(obj, node_id1, node_id2, weight = NA, mode = "all")
ShortestPath(obj, node_id1, node_id2, weight = NA, mode = "all") ## S3 method for class 'intensitynet' ShortestPath(obj, node_id1, node_id2, weight = NA, mode = "all")
obj |
intensitynet object |
node_id1 |
starting node |
node_id2 |
ending node |
weight |
an string, calculate the shortest path based on this type of weight. If no weight type is provided, the function will calculate the shortest path based on the minimum amount of edges. Default NA. |
mode |
Character 'in', 'out', 'all' (default). Gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. This argument is ignored for undirected graphs. |
total weight of the shortest path and the path vertices with class igraph.vs
data("und_intnet_chicago") ShortestPath(und_intnet_chicago, node_id1 = 'V1', node_id2 = 'V300', weight = 'intensity')
data("und_intnet_chicago") ShortestPath(und_intnet_chicago, node_id1 = 'V1', node_id2 = 'V300', weight = 'intensity')
Give information about the intensytinet object specific class (intensitynetUnd, intensitynetDir, or intensitynetMix), the network number of nodes, edges and events, the event correction value and, if the events had been related to the intensitynet object network.
## S3 method for class 'intensitynet' summary(object, ...)
## S3 method for class 'intensitynet' summary(object, ...)
object |
Intensitynet object |
... |
Extra parameters for the summary function |
list containing the displayed information
data("und_intnet_chicago") summary(und_intnet_chicago)
data("und_intnet_chicago") summary(und_intnet_chicago)
This data is an intensitynet object containing an undirected network. The base data used is from Chicago, extracted from the spatstat package.
und_intnet_chicago
und_intnet_chicago
An object of class intensitynetUnd
(inherits from intensitynet
) of length 6.
https://rdrr.io/cran/spatstat.data/man/chicago.html
Creates a directed adjacency matrix from an Undirected one with random directions (in-out edges) but with the same connections between nodes.
## S3 method for class 'netTools' Undirected2RandomDirectedAdjMtx(obj)
## S3 method for class 'netTools' Undirected2RandomDirectedAdjMtx(obj)
obj |
netTools object -> list(mtx: matrix) |
directed adjacency matrix with random directions