egor
objectR/read.ego.folders.R
read_egonet.Rd
This function imports ego-centered network data from folders with separate files for alters-level and edge data. It will run some basic checks upon the completeness of the data and inform the user of potential problems. This function can be used to import data exported from EgoNet (McCarty 2011).
read_egonet(
egos.file,
alter.folder,
edge.folder,
csv.sep = ",",
ID.vars = list(ego = "egoID", alter = "alterID", source = "Source", target = "Target"),
first.col.row.names = FALSE,
...
)
File name of the .csv file containing the ego data.
Folder name of the folder containing the alter data in separate .csv files for each ego/ network.
Folder name of the folder containing the edge/ tie data in separate .csv files for each ego/ network.
Character
indicating the separator used in csv files.
A named list containing column names of the relevant input columns:
ego
unique identifier associated with each ego, defaulting
to "egoID"
; has no effect if alters.df
and aaties.df
are
both lists of data frames.
alter
unique-within-ego identifier associated with each
alter, defaulting to "alterID"
; optional aaties.df
are not
provided.
source
if aaties.df
is provided, the column given the
alter identifier of the origin of a relation.
target
if aaties.df
is provided, the column given the
alter identifier of the destination of a relation.
Boolean
indicating if first column contains
row names, that are to be skipped, default is FALSE
.
additional arguments to egor()
.
An egor object is returned. It is a list
of three data frames:
(1) ego: dataframe
of all
egos and their attributes;
(2) alter: dataframe
of all alters;
(3) aatie: dataframe
of alter alter ties/ edges
egos.file <- system.file("extdata", "egos_32.csv", package = "egor")
alters.folder <- system.file("extdata", "alters_32", package = "egor")
edge.folder <- system.file("extdata", "edges_32", package = "egor")
ef <- read_egonet(egos.file = egos.file,
alter.folder = alters.folder,
edge.folder = edge.folder,
csv.sep = ";")
#> Reading ego data.
#> Checking if alter.files and edge.files correspond
#> Creating $alters.df and $alters.list
#> Creating edge lists: $edges