get.node.attr: Retrieve and check assumptions about vertex attributes (nodal...

View source: R/get.node.attr.R

get.node.attrR Documentation

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 documentation built on Oct. 7, 2024, 5:08 p.m.