xyzmatrix: Get and assign coordinates for classes containing 3D vertex...

View source: R/xform.R

xyzmatrixR Documentation

Get and assign coordinates for classes containing 3D vertex data

Description

xyzmatrix gets coordinates from objects containing 3D vertex data

xyzmatrix<- assigns xyz elements of neuron or dotprops object and can also handle matrix like objects with columns named X, Y, Z or x, y, z.

Usage

xyzmatrix(x, ...)

## Default S3 method:
xyzmatrix(x, y = NULL, z = NULL, ...)

## S3 method for class 'neuron'
xyzmatrix(x, ...)

## S3 method for class 'neuronlist'
xyzmatrix(x, ...)

## S3 method for class 'dotprops'
xyzmatrix(x, ...)

## S3 method for class 'hxsurf'
xyzmatrix(x, ...)

## S3 method for class 'igraph'
xyzmatrix(x, ...)

## S3 method for class 'mesh3d'
xyzmatrix(x, ...)

xyzmatrix(x) <- value

## S3 replacement method for class 'neuron'
xyzmatrix(x) <- value

## S3 replacement method for class 'dotprops'
xyzmatrix(x) <- value

## S3 replacement method for class 'hxsurf'
xyzmatrix(x) <- value

## S3 replacement method for class 'igraph'
xyzmatrix(x) <- value

## S3 replacement method for class 'shape3d'
xyzmatrix(x) <- value

## S3 replacement method for class 'neuronlist'
xyzmatrix(x) <- value

Arguments

x

object containing 3D coordinates

...

additional arguments passed to methods

y, z

separate y and z coordinates

value

Nx3 matrix specifying new xyz coords

Details

Note that xyzmatrix can extract or set 3D coordinates in a matrix or data.frame that either has exactly 3 columns or has 3 columns named X,Y,Z or x,y,z.

Value

For xyzmatrix: Nx3 matrix containing 3D coordinates

For xyzmatrix<-: Original object with modified coords

See Also

xyzmatrix

Examples

# see all available methods for different classes
methods('xyzmatrix')
# ... and for the assignment method
methods('xyzmatrix<-')
n=Cell07PNs[[1]]
xyzmatrix(n)<-xyzmatrix(n)
stopifnot(isTRUE(
  all.equal(xyzmatrix(n),xyzmatrix(Cell07PNs[[1]]))
))

nat documentation built on Aug. 25, 2023, 5:16 p.m.