Description Usage Arguments Value Examples
Standalone function for creating pkg 'network' node (vertex) attribute.
1 | netVtxAttr(pAttrMasterDF, pSIDVec, pNetwork)
|
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. |
A dataframe with two columns: SID (integer) and the associated values of some variable (numerical).
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.