Minor edits for more efficient code

Made minor edits for more efficient code in disciplines.graph.R and
union.graph.R based on work in branch no-discipline-split.