Bay Area useR Group (R Programming Language) Message Board › Bay Area useR Group (R Programming Language) Discussion Forum › Writing functions that affect network attributes... how to return changed?
|A former member||
First, I'm not using data frames, though maybe I should be. I'm using the network package.
What I've done is written a function which returns a matrix of 3d locations, with 2D representational locations generated from a particular point of perspective.
In order to use my various tools, I would like the _network_ object itself to hold onto this information. So for example, I've generated a matrix with five columns, locations. I can set vertex attributes in the console (using RStudio), but I can't seem to submit a network object to a function and return a network object with the vertex attributes changed.
What this means is that I must permanently have an affiliated matrix in which I keep the locations, and then I can in the console have the network object hold onto those, but I can't have a function assign them to the network object.
In the reverse, I can strip location data from the network vertex attributes, just not vice versa.