duplicate: Check for duplicate number sequences

Description Usage Arguments Details Value Examples

Description

A function checking whether a vector is already a row of a matrix. This function is called by createTest while generating numeric sequences for the test.

Usage

1
duplicate(mx, vec)

Arguments

mx

a matrix in which function duplicate searches for a specified vector

vec

a vector for which a specified matrix is searched

Details

Length of the vector must be equal to the number of columns in the searched matrix.

Value

This function can return two values

TRUE

means that such vector already is in the matrix

FALSE

means that no such vector is in the matrix

Examples

1
2
3
4
5
6
m<-matrix(c(1:5,5:1,c(1,2,5,4,3)),3,5,byrow=TRUE)
r<-1:5
g<-c(1:4,4)

duplicate(mx=m,vec=r) # TRUE - there is already such vector in a matrix
duplicate(mx=m,vec=g) #FALSE - no cuch vector in the matrix

ruleR documentation built on May 2, 2019, 5:49 p.m.