Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get.node.attr

Retrieve and check assumptions about vertex attributes (nodal covariates) in a network


Description

The get.node.attr function returns the vector of nodal covariates for the given network and specified attribute if the attribute exists - execution will halt if the attribute is not correctly given as a single string or is not found in the vertex attribute list; optionally get.node.attr will also check that return vector is numeric, halting execution if not. The purpose is to validate assumptions before passing attribute data into an ergm term.

Usage

get.node.attr(nw, attrname, functionname = NULL, numeric = FALSE)

Arguments

nw

a network object

attrname

the name of a nodal attribute, as a character string

functionname

the name of the calling function a character string; this is only used for the warning messages that accompany a halt

numeric

logical, whether to halt execution if the return vector is not numeric; default=FALSE

Value

returns the vector of 'attrname' covariates for the vertices in the network

See Also

get.vertex.attribute for a version without the checking functionality

Examples

data(faux.mesa.high)
get.node.attr(faux.mesa.high,'Grade')

ergm

Fit, Simulate and Diagnose Exponential-Family Models for Networks

v3.11.0
GPL-3 + file LICENSE
Authors
Mark S. Handcock [aut], David R. Hunter [aut], Carter T. Butts [aut], Steven M. Goodreau [aut], Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Martina Morris [aut], Li Wang [ctb], Kirk Li [ctb], Skye Bender-deMoll [ctb], Chad Klumb [ctb], Michał Bojanowski [ctb], Ben Bolker [ctb]
Initial release
2020-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.