Learn R Programming

tropAlgebra (version 0.1.0)

swapVector: Swap Vectors

Description

This function swaps the values of both vectors, Both Vectors must have equal length.

Usage

swapVector(x,y)

Arguments

x

A vector

y

A vector

Value

Returns the swapped vectors x and y

Details

e.g. [1] [2] [3] 6 7 8 vector X ................... [1] [2] [3] 3 2 1 vector Y ................... Now function call: swapVector(x,y) Then swapped vectors are : [1] [2] [3] 6 7 8 vector Y ................... [1] [2] [3] 3 2 1 vector X

Examples

Run this code
# NOT RUN {
x<-c(6,7,8)
y<-c(3,2,1)
    swapVector(x,y)
# }

Run the code above in your browser using DataLab