Learn R Programming

netjack (version 1.2.0)

net_apply: Apply a network manipulation function to a single network, or to a sample of networks

Description

This function applies a network manipulation function to a single network or sample of networks, and returns a NetSet, or NetSampleSet containing the results.

Usage

net_apply(network, net.function, net.function.args, orig.net.name)

# S4 method for Net,ANY,ANY,ANY net_apply(network, net.function, net.function.args, orig.net.name)

# S4 method for NetSample,ANY,ANY,missing net_apply(network, net.function, net.function.args, orig.net.name)

Arguments

network

An Net object or a NetSample object

net.function

A network manipulation function (reference or character)

net.function.args

A labeled list containing arguments to the net.function

orig.net.name

The original network name, when applying net_apply to a Net

Value

A NetSet or NetSampleSet object

Methods (by class)

  • network = Net,net.function = ANY,net.function.args = ANY,orig.net.name = ANY: net_apply for Net

  • network = NetSample,net.function = ANY,net.function.args = ANY,orig.net.name = missing: net_apply for NetSample

Examples

Run this code
# NOT RUN {
data(GroupA)
GroupA_Net = as_NetSample(GroupA, 1:20, node.variables = list(community = c(rep(1, 10), rep(2,10))),
 sample.variables = list(group = c(rep(1, 10), rep(2,10))))
Jackknife_GroupA_Net = net_apply(GroupA_Net, node_jackknife)
# }

Run the code above in your browser using DataLab