NetInd.to.sparseAdjMat: Convert Network IDs Matrix into Sparse Adjacency Matrix

Description Usage Arguments Value See Also

View source: R/network.R

Description

Convert simcausal network ID matrix (NetInd_k) into a network represented by a sparse adjacency matrix.

Usage

1
NetInd.to.sparseAdjMat(NetInd_k, nF)

Arguments

NetInd_k

Matrix of network IDs of dimension (n=nrow(sparseAdjMat),Kmax), where each row i consists of the network IDs (row number of friends) of observation i. Remainders are filled with NAs.

nF

Integer vector of length n specifying the number of friends for each observation.

Value

Network represented as a sparse adjacency matrix (S4 class object dgCMatrix from package Matrix). NOTE: The friend IDs for observation i will be listed in column i (i.e, which(sparseAdjMat[,i]) are friends of i).

See Also

network; sparseAdjMat.to.igraph; igraph.to.sparseAdjMat; sparseAdjMat.to.NetInd;


osofr/simcausal documentation built on Jan. 6, 2019, 3:05 a.m.