Helper functions of EgoStats. Some may be documented and exported in the future.
.attrErr(term, attrname, req = c("one", "both")).unfactor(x)
.degreeseq(egor)
.alterEgos(egor)
.exsum(x)
.extabulate(bin, nbins = max(1, bin, na.rm = TRUE))
.matchNA(x, table, nomatch = NA_integer_, incomparables = NULL)
.pasteNA(..., sep = " ", collapse = NULL)
.sapply_col(..., simplify = TRUE)
.mapply_col(..., SIMPLIFY = TRUE)
split_egos_by_ego(x, egor)
split_alters_by_ego(x, egor)
split_aaties_by_ego(x, egor)
.checkNA(x, ...)
a vector.
an egor()
object.
Additional arguments to subroutines.
.attrErr()
: Construct and throw an error message about ego or alter attributes being missing.
.unfactor()
: Convert a factor to its "ordinary" vector representation.
.degreeseq()
: Degree sequence of the egos.
.alterEgos()
: Ego index (i.e., row) associated with each alter.
.exsum()
: As sum()
, but "extrapolating" the NA
s.
.extabulate()
: As tabulate()
, but "extrapolating" the NA
s.
.matchNA()
: As base::match()
, but NA
s are passed through.
.pasteNA()
: As paste()
, but NA
s are passed through rather than typeset.
.sapply_col()
: As sapply()
, but if the function returns a vector, return those
vectors in rows, and if it returns a scalar, return a column
vector.
.mapply_col()
: As mapply()
, but if the function returns a vector, return those
vectors in rows, and if it returns a scalar, return a column
vector.
split_egos_by_ego()
: Split an arbitrary vector or matrix by egos.
split_alters_by_ego()
: Split an arbitrary vector or matrix by egos.
split_aaties_by_ego()
: Split an arbitrary vector or matrix by egos.
.checkNA()
: Pass through the input if it does not contain mising values; otherwise stop with given error. Arguments after the first are passed through to stop()
.