swapVector: Swap Vectors

Description Usage Arguments Details Value Examples

Description

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

Usage

1

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

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

tropAlgebra documentation built on May 2, 2019, 7:29 a.m.