as.data.frame.movement_matrix: Convert a movement_matrix object into a data.frame

View source: R/movement.R

as.data.frame.movement_matrixR Documentation

Convert a movement_matrix object into a data.frame

Description

Convert a movement_matrix object into a data.frame with columns origin (character), destination (character) and movement (numeric). The origins and the destinations are taken from the row and column names of the matrix, respectively. The entries where origins are equal to destinations (that is, the matrix diagonal) are removed during this conversion process.

Usage

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

Arguments

x

a movement_matrix object.

...

additional arguments to be passed to or from methods.

Value

A data.frame with columns origin (character), destination (character) and movement (numeric)

Note

If the given matrix does not contain any row or column names, the function will generate a warning and the origin and destinations will be the row and column numbers of the relevant matrix cell.


SEEG-Oxford/movement documentation built on April 17, 2023, 4:17 p.m.