Description Usage Arguments Value Examples

View source: R/spatial.R View source: R/spatial.R

Creates a square matrix suitable for spatial statistics models.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
diag_expand(...)
## S3 method for class 'list'
diag_expand(graph, self = getOption("diffnet.self"),
valued = getOption("diffnet.valued"), ...)
## S3 method for class 'diffnet'
diag_expand(graph, self = getOption("diffnet.self"),
valued = getOption("diffnet.valued"), ...)
## S3 method for class 'matrix'
diag_expand(graph, nper,
self = getOption("diffnet.self"),
valued = getOption("diffnet.valued"), ...)
## S3 method for class 'array'
diag_expand(graph, self = getOption("diffnet.self"),
valued = getOption("diffnet.valued"), ...)
## S3 method for class 'dgCMatrix'
diag_expand(graph, nper,
self = getOption("diffnet.self"),
valued = getOption("diffnet.valued"), ...)
``` |

`...` |
Further arguments to be passed to the method. |

`graph` |
Any class of accepted graph format (see |

`self` |
Logical scalar. When |

`valued` |
Logical scalar. When |

`nper` |
Integer scalar. Number of time periods of the graph. |

A square matrix of class `dgCMatrix`

of
size `(nnode(g)*nper)^2`

1 2 3 4 5 6 7 8 9 10 | ```
# Simple example ------------------------------------------------------------
set.seed(23)
g <- rgraph_er(n=10, p=.5, t=2,undirected=TRUE)
# What we've done: A list with 2 bernoulli graphs
g
# Expanding to a 20*20 matrix with structural zeros on the diagonal
# and on cell 'off' adjacency matrix
diag_expand(g)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.