as.data.frame.im: Convert Pixel Image to Data Frame

Description Usage Arguments Details Value Author(s) Examples

View source: R/images.R

Description

Convert a pixel image to a data frame

Usage

1
2
  ## S3 method for class 'im'
as.data.frame(x, ...)

Arguments

x

A pixel image (object of class "im").

...

Further arguments passed to as.data.frame.default to determine the row names and other features.

Details

This function takes the pixel image x and returns a data frame with three columns containing the pixel coordinates and the pixel values.

The data frame entries are automatically sorted in increasing order of the x coordinate (and in increasing order of y within x).

Value

A data frame.

Author(s)

\spatstatAuthors

.

Examples

1
2
3
4
5
6
   # artificial image
   Z <- setcov(square(1))

   Y <- as.data.frame(Z)

   head(Y)

spatstat.geom documentation built on April 15, 2021, 9:06 a.m.