# The supra-hexagonal grid is exactly determined by specifying the radius.
res <- sHexGrid(r=2)
# The grid is determined according to the number of input hexagons (after being adjusted).
# The return res$nHex is always no less than the input one.
# It ensures a supra-hexagonal grid is exactly formed.
res <- sHexGrid(nHex=12)
# Ignore input nHex if r is also given
res <- sHexGrid(r=3, nHex=100)
# By default, r=3 if no parameters are specified
res <- sHexGrid()
Run the code above in your browser using DataLab