Learn R Programming

rphylopic (version 1.0.0)

get_phylopic: Retrieve an image for a given PhyloPic uuid

Description

This retrieves a PhyloPic silhouette as a vectorized or rasterized object.

Usage

get_phylopic(uuid = NULL, format = "vector")

Value

If format is "vector", a Picture

object is returned. Otherwise, a png array representing the rasterized image is returned. Either way, the uuid and download url are included as the "uuid" and "url" attributes, respectively.

Arguments

uuid

A PhyloPic image uuid.

format

Format of the image. To return a vectorized image, use "vector". To return a rasterized image, use one of 512, 1024, or 1536. Rasterized thumbnails can be returned by using 64, 128, or 192. Finally, using "twitter" will return a rasterized image that includes the PhyloPic logo and is formatted for posting on social media.

Examples

Run this code
# uuid
uuid <- "9fae30cd-fb59-4a81-a39c-e1826a35f612"

# Get data for an image
img_svg <- get_phylopic(uuid, format = "vector") # vector format
img_png <- get_phylopic(uuid, format = "512") # raster format

Run the code above in your browser using DataLab