R code for parsing Structure output for plotting