I am transferring between NetLogo and igraph (in R). Some of the information returned from igraph is 2-level nested lists of strings. Typical example looks like:
[ ["1" "2" "3"] ["4"] ]
I want to convert the internal strings into numbers, while retaining the list structure. So the example would become:
[ [1 2 3] [4] ]
I am guessing I need a combination of map
and read-from-string
(and perhaps other list manipulation like lput
and foreach
due to the nesting), but I just can't make it work.
Any ideas?