Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

completeMatrix

Complete a Distances Matrix


Description

Completes the bottom diagonal of a matrix with the same number of rows and columns.

Usage

completeMatrix(x)

Arguments

x

A distances matrix to be completed.

Details

It is highly recommended to read the vignette regarding distances matrix before running this function. You can find it by running vignette('a-2_distances_matrix', 'actel') or browseVignettes('actel')

Value

A matrix of distances between pairs of points.

Examples

# Create dummy matrix with upper diagonal filled.
x <- matrix(
 c( 0,  1,  2,  3,  4, 5,
   NA,  0,  1,  2,  3, 4,
   NA, NA,  0,  1,  2, 3,
   NA, NA, NA,  0,  1, 2,
   NA, NA, NA, NA,  0, 1,
   NA, NA, NA, NA, NA, 0),
 ncol = 6, byrow = TRUE)

# inspect x
x

# run completeMatrix
completeMatrix(x)

actel

Acoustic Telemetry Data Analysis

v1.2.1
GPL-3
Authors
Hugo Flávio [aut, cre] (<https://orcid.org/0000-0002-5174-1197>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.