<｜begin▁of▁sentence｜>### Instruction:
Given a branching factor r and a total number of nodes n, can you generate a full r-ary tree using NetworkX, where each non-leaf node has exactly r children and all levels are full except possibly for the rightmost position of the bottom level?
### Response:
import networkx as nx

# Create a full binary tree of 10 nodes
r = 2  # branching factor (binary tree)
n = 10  # number of nodes

# Generate the full r-ary tree
full_tree = nx.full_rary_tree(r, n)

# Draw the tree using matplotlib (optional)
import matplotlib.pyplot as plt
nx.draw(full_tree, with_labels=True, node_size=500, node_color='skyblue')
plt.show()
<|EOT|>
