Learn R Programming

stopmotion (version 0.1.0)

read: Read images into a stop-motion film

Description

Reads all image files from dir (optionally filtered by pattern) and returns them as a magick-image object.

Usage

read(dir, pattern = "")

Value

an object of class magick-image

Arguments

dir

path to directory containing the images relative to working directory.

pattern

an optional regular expression. Only file names which match the regular expression will be returned.

Frame order

Frames are loaded in the order returned by list.files, which sorts filenames lexicographically. This means the filesystem filename order determines the stop-motion frame order. Name your files accordingly (e.g. frame_001.png, frame_002.png, ...) to guarantee the intended sequence. If you need to reorder frames after loading, use arrange.

Examples

Run this code
 # \donttest{
   dino_dir <- system.file("extdata", package = "stopmotion")
   images <- read(dir = dino_dir)
# }

Run the code above in your browser using DataLab