ineq: An Inequality Function

View source: R/ineq_function.R

ineqR Documentation

An Inequality Function

Description

This function allows the user to count the number of values/rows that match the inequality.

Usage

ineq(x, val, eq)

Arguments

x

Data to pass through function. Vector with multiple values

val

Value to evaluate with inequality

eq

inequality symbol as a character. Options are ">", "<", ">=", "<=", or "=".

Value

Value of observations that fit the condition given.

Examples

### Create Test data
a<-seq(1,5,by=1)
b<-seq(1,10,by=2)
c<-seq(1,15,by=3)
data<-data.frame(a,b,c)

#for vector:
ineq(a,val=3,eq="<")

#for dataframe:
apply(data,2,function(x) ineq(x,val=4,eq=">"))


Louismp1223/LMP3 documentation built on June 29, 2022, 5:11 p.m.