Learn R Programming

colordistance (version 1.1.2)

getImagePaths: Fetch paths to all valid images in a given directory

Description

Find all valid image paths (PNG and JPG) in a directory (does not search subdirectories). Will recover any image ending in .PNG, .JPG, or .JPEG, case-insensitive.

Usage

getImagePaths(path)

Arguments

path

Path to directory in which to search for images. Absolute or relative filepaths are fine.

Value

A vector of absolute filepaths to JPG and PNG images in the given directory.

Examples

Run this code
# NOT RUN {
im.dir <- colordistance::getImagePaths(system.file("extdata",
"Heliconius/Heliconius_A", package="colordistance"))
# }
# NOT RUN {
im.dir <- colordistance::getImagePaths("some/nonexistent/directory")
# }
# NOT RUN {
im.dir <- colordistance::getImagePaths(getwd())

# }

Run the code above in your browser using DataLab