swapVector {tropAlgebra}R Documentation

Swap Vectors

Description

This function swaps the values of both vectors. This function works only if both vectors have equal length.

Usage

swapVector(x,y)

Arguments

x

A vector.

y

A vector.

Details

If the lengths of both vectors are not same, it generates an error. This function swaps the vectors in memory(like pass by reference), it does not return the vectors, but interchanges their values.

Value

Swapped vectors x and y.

Examples

x<-c(6,7,8)
y<-c(3,2,1)
swapVector(x,y)

[Package tropAlgebra version 0.1.1 Index]