as.egor | R Documentation |
The function egor()
is used to create an egor object from
ego-centered network data. as.egor()
converts a list of igraph
/network
objects or
a nested_egor
objects to an egor
object.
as.egor(x, ...)
## S3 method for class 'nested_egor'
as.egor(
x,
ID.vars = list(ego = ".egoID", alter = ".alterID", source = ".Source", target =
".Target"),
...
)
## S3 method for class 'list'
as.egor(x, ego_name = NULL, ...)
egor(
alters,
egos = NULL,
aaties = NULL,
ID.vars = list(ego = "egoID", alter = "alterID", source = "Source", target = "Target"),
ego_design = NULL,
alter_design = list(max = Inf)
)
x |
|
... |
arguments to be passed to methods |
ID.vars |
A named list containing column names of the relevant input columns:
|
ego_name |
|
alters |
either a |
egos |
|
aaties |
|
ego_design |
A |
alter_design |
A
|
If parameters alters.df
, egos.df
, and aaties.df
are
data frames, they need to share a common ego ID variable, with
corresponding values. If alters.df
and aaties.df
are lists of
data frames, egoID
is ignored and they are matched by position
with the rows of egos.df
. Of the three parameters only
alters.df
is necessary to create an egor
object, and
egos.df
and aaties.df
are optional.
Returns an egor
object, which is a named list
with three
tibble data.frames
: ego, alter and aatie (alter-alter ties).
Each data set has an .egoID
column, that groups the data belonging to one
ego. Additionally the alter data has an .alterID
column, that links to
the columns .srcID
and .tgtID
in the alter-alter tie data.
In addition, egor
has two attributes: ego_design
, containing an
object returned by srvyr::as_survey_design()
specifying the sampling
design by which the egos were selected and alter_design
, a
list
containing specification of how the alters were
nominated. See the argument above for currently implemented
settings.
as.egor(nested_egor)
: Can convert (legacy) nested_egor
object to egor
object.
Column names .alts
, .aaties
, and .egoRow
are reserved
for internal use of egor
and should not be used to store
persistent data. Other .
-led column names may be reserved in
the future.
as_tibble()
for extracting ego, alter, and alter–alter tables, as tibble
s or as srvyr
's tbl_svy
surveys.
data("egos32")
data("alters32")
data("aaties32")
egor(alters32,
egos32,
aaties32,
ID.vars = list(ego = ".EGOID",
alter = ".ALTID",
source = ".SRCID",
target = ".TGTID"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.