wide.to.long: Transform 'wide' alter-level data to the 'long'-format

View source: R/read.egonet.R

wide.to.longR Documentation

Transform 'wide' alter-level data to the 'long'-format

Description

A function to transform a wide-format dataframe of ego-centered network data into a long-format data-frame, where every row represents one alter/dyad. In the created dataframe numerous networks can be distinguished by a network ID (egoID).

Usage

wide.to.long(
  wide,
  egoID = "egoID",
  max.alters,
  start.col,
  end.col,
  var.wise = FALSE
)

Arguments

wide

A data.frame of alter attributes in the wide format.

egoID

Character. Name of the variable identifying egos (default: "egoID").

max.alters

A numeric giving the maximum number of alters.

start.col

Index or name of the first column containing alter-alter relation data. #!# Should: Defaults to first column of wide.

end.col

Index or name of the first column containing alter-alter relation data. #!# Should: Defaults to last column of wide.

var.wise

a logical value indicating whether the alter attributes are stored variable-wise, if FALSE alter-wise storage is assumed.


egor documentation built on May 29, 2024, 12:10 p.m.