getimg: Import image data

View source: R/getimg.R

getimgR Documentation

Import image data

Description

Finds and imports PNG, JPEG, and/or BMP images.

Usage

getimg(imgpath = getwd(), subdir = FALSE, subdir.names = FALSE, max.size = 1)

Arguments

imgpath

(required) either the full file-path or URL to an image (including extension), or the path to a folder in which multiple image files are located. Mixed file formats within a folder are accepted.

subdir

should subdirectories within the imgpath folder be included in the search? (defaults to FALSE).

subdir.names

should subdirectory path be included in the name of the images? (defaults to FALSE).

max.size

maximum size of all images to be allowed in memory, in GB. Defaults to 1.

Value

a image, or list of images, of class rimg, for use in further pavo functions.

Author(s)

Thomas E. White thomas.white026@gmail.com

Examples

# Single image
papilio <- getimg(system.file("testdata/images/butterflies/papilio.png", package = "pavo"))

# Multiple images
snakes <- getimg(system.file("testdata/images/snakes", package = "pavo"))

pavo documentation built on Sept. 24, 2023, 5:06 p.m.