survey_to_edgelist: Creates an edgelist (or a list of edgelist) from survey data

Description Usage Arguments Details Value Examples

View source: R/readnet.r

Description

The function grabs ego ids and its nominations and creates an edgelist in which the labels (ids) are recoded such that ids go from 1 to n.

Usage

1
2
survey_to_edgelist(data, ego.id, alter.id, group.id = NULL, time = NULL,
  group.sep = "-", time.sep = "-")

Arguments

data

A data.frame with the data to be read in.

ego.id, alter.id

Character scalars. Names of the variables in dat that correspond to the ids of ego and alter. It does not need to be numeric (see details).

group.id

Character vector.

time

Character vector.

group.sep

Character scalar.

time.sep

Character scalar.

Details

By default, ego.id and alter.id are transform to factor variables, so the user doesn't need to worry about giving individuals in the survey a special coding

Value

If no group.id or time are provided, an integer matrix with two named columns (ego and alter), and an attribute "labels". Otherwise will return a nested list in which the first level is given by group.id, and the second level by time (if provided).

Examples

1
1+1

USCCANA/readnet documentation built on May 28, 2019, 3:18 p.m.