ggmorph_tile | R Documentation |
Tile morphs within a morphological space
ggmorph_tile(
space,
imgs,
dimensions = c(1, 2),
steps = 5,
n_imgs = 5,
adjust_grey = TRUE,
scale = 0.01,
fun = NULL,
...
)
space |
morphological space object created by |
imgs |
vector of paths to images; should have as many elements as are in the morphological space |
dimensions |
couple of dimensions to plot. |
steps |
number of steps along each dimension that define the tiles. |
n_imgs |
number of images to randomly select and morph in each tile. |
adjust_grey |
whether to adjust the mean grey level of the morphed image to match that of the original images it was constructed with. Usually, computing the average (i.e. the morphing) results in lighter images; this compensates it a little. Note that it requires more intense computation and is therefore switched off by default. |
scale |
scaling factor used to display the images; from pixels to morphological space dimensions units. |
fun |
function to apply to each image, as a pre-processing step (a typical one is |
... |
passed to |
space <- morphospace(plank[,-(1:2)], weights=plank$conc)
img_root <- system.file("extdata", "plank", package="morphr")
imgs <- file.path(img_root, paste0(plank$id, ".jpg"))
ggmorph_tile(space, imgs, fun=img_chop, bottom=10)
ggmorph_tile(space, imgs, step=8, scale=0.005)
ggmorph_tile(space, imgs, dim=c(3,4), scale=0.004)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.