Skip to contents

subset_netlet takes in a netify object and allows for the extraction of smaller networks.

Usage

subset_netlet(
  netlet,
  what_to_subset = NULL,
  what_rows_to_subset = what_to_subset,
  what_cols_to_subset = what_to_subset,
  when_to_subset = NULL,
  what_layers_to_subset = NULL
)

Arguments

netlet

object of class netify

what_to_subset

enter the name of specific nodes to subset in character vector form or provide a numeric range, default is to show the first three rows and columns of interactions

what_rows_to_subset

similar as what_to_subset but specific to rows, default value is set to what_to_subset. If you want to subset at all rows then set this to NULL.

what_cols_to_subset

similar as what_to_subset but specific to columns, default value is set to what_to_subset. If you want to subset at all columns then set this to NULL.

when_to_subset

choose time points to subset from, default is to show the first time point of data. If the entry is a numeric value or vector then it will be used as an index to the time dimension. If the entry is a character vector then it will be used to match the time dimension labels. If you want to subset at all time points then set this to NULL.

what_layers_to_subset

if the netlet object has multiple layers, then you must choose one layer to subset at.

Value

a subset of the original network that has relevant netify attributes

Author

Cassy Dorff, Shahryar Minhas

Examples


# load example directed event data from ICEWS
data(icews)

# generate a longitudional netify object 
# with both dyadic and nodal attributes
icews_matlConf <- netify(
    dyad_data=icews,
    actor1='i', actor2='j', time='year',
    symmetric=FALSE, weight='matlConf',
    nodal_vars=c('i_polity2', 'i_log_gdp', 'i_log_pop'),
    dyad_vars=c('matlCoop', 'verbCoop', 'verbConf'),
    dyad_vars_symmetric=c(FALSE, FALSE, FALSE) )  

# subset to a few countries
icews_matlConf_subset <- subset_netlet(
   netlet=icews_matlConf,
  what_to_subset=c('United States', 'United Kingdom',
     'Russian Federation', 'China') )

# subset to a few countries and a few years
icews_matlConf_subset <- subset_netlet(
  netlet=icews_matlConf,
 what_to_subset=c('United States', 'United Kingdom',
    'Russian Federation', 'China'),
when_to_subset=c('2010', '2011') )