Learn R Programming

imager (version 0.14)

as.data.frame.cimg: Convert a pixel image to a data.frame

Description

This function combines the output of pixel.grid with the actual values (stored in $value)

Usage

## S3 method for class 'cimg':
as.data.frame(x, ...)

Arguments

x
an image of class cimg
...
arguments passed to pixel.grid

Value

  • a data.frame

Examples

Run this code
im <- matrix(1:16,4,4) %>% as.cimg
as.data.frame(im) %>% head

Run the code above in your browser using DataLab