R script to neatly align hexagon stickers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README_files/figure-markdown_github
samplehex
.gitignore
README.Rmd
README.md
hexwall.R
hexwall.Rproj

README.md

hexwall

The hexwall.R file contains one function hexwall(), which can be used to generate an image that neatly arranges a folder of hexagons. It makes use of the ImageMagick library via the ROpenSci package magick to arrange the images.

There are several arguments allowing some control over the function's operation.

  • path: The path to a folder of hexagon stickers (png files are recommended)
  • sticker_row_size: The number of stickers in the longest row
  • sticker_width: The width of each sticker in pixels
  • remove_small: Should hexagons smaller than the sticker_width be removed?
  • remove_size: Should hexagons of an abnormal size be removed?
  • coords: A data.frame of coordinates defining the placement of hexagons
  • scale_coords: Should the coordinates be scaled to the hexagon size?
  • sort_mode: How should the files be sorted?
source("hexwall.R")
#> Linking to ImageMagick 6.9.7.4
#> Enabled features: fontconfig, freetype, fftw, lcms, pango, x11
#> Disabled features: cairo, ghostscript, rsvg, webp
hexwall("samplehex", sticker_row_size = 3, sticker_width = 200)

Usage

  1. Download the repository
  2. Unzip and open the R project (hexwall.Rproj)
  3. Run source("hexwall.R")
  4. Ready to go, use the hexwall() function to make your hexagon wall.