This function downloads a silhouette from the PhyloPic database. With the new API, some functions of the package rphylopic don't work anymore. This function aims to temporary replace the function rphylopic::image_data() as this package seems to be looking for a new maintainer.

get_phylopic_image(uuid, size = 512)

Arguments

uuid

a character of length 1. The UUID (unique taxa identifier in the Phylopic database).

size

an integer of length 1. The size of the PNG to download. An error will be raised in the size is not available.

Value

An array of dimensions red x green x blue x alpha.

Examples

if (FALSE) {
mammals_pic <- get_phylopic_image("8cad2b22-30d3-4cbd-86a3-a6d2d004b201")

## Plot the silhouette ----
ggplot2::ggplot(x = Sepal.Length, y = Sepal.Width, data = iris, 
                geom = "point") +
rphylopic::add_phylopic(mammals_pic, alpha = 1)
}