as.data.frame.im {spatstat}R Documentation

Convert Pixel Image to Data Frame

Description

Convert a pixel image to a data frame

Usage

  ## 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.

Value

A data frame

Author(s)

Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz

Examples

   # artificial image
   Z <- setcov(square(1))

   Y <- as.data.frame(Z)

   head(Y)

[Package spatstat version 1.25-3 Index]