netVtxAttr: Returns a dataframe DF with col.2 a suitable 'network' node...

Description Usage Arguments Value Examples

Description

Standalone function for creating pkg 'network' node (vertex) attribute.

Usage

1
netVtxAttr(pAttrMasterDF, pSIDVec, pNetwork)

Arguments

pAttrMasterDF

A two-column dataframe with SID and the values of some numerical variable 'x' as the columns. It should include all SIDs for some school and wave range (e.g. as generated by 'getSWNodes') for which there are data (if no data, attribute will be 'NA'). The SIDs actually used are selected from the next parameter.

pSIDVec

An ordered vector of SIDs exactly matching the 'node set' for the network of interest; e.g. if the network has n nodes, the length of the returned dataframe will be n.

pNetwork

The 'network' object to assign the vertex attribute to. This is not actually used to do the assignment, but rather, for some consistency checking.

Value

A dataframe with two columns: SID (integer) and the associated values of some variable (numerical).

Examples

1
2
3
4
5
6
# AL134DF is a dataframe as output by 'createOnset'.
# Because this analysis is descriptive, this code creates a vertex
# attribute for just one wave, and in the 2nd statement, assigns it as
# a 'network' vertex attribute, naming it 'AlcOns'
ALDF.w1 <- netVtxAttr(AL134DF[,c("SID","al.1")],ds.winsSID1,ds.winsOBF1.no)
ds.winsOBF1.no %v% "AlcOns" <- ALDF.w1$al.1

johninpdx/RSTools documentation built on May 19, 2019, 5:15 p.m.