Package uk.co.terminological.rjava.utils
Class RFunctions
java.lang.Object
uk.co.terminological.rjava.utils.RFunctions
RFunctions class.
- Version:
- $Id: $Id
- Author:
- vp22681
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <X extends RPrimitive>
booleanall(BiPredicate<X, X> tester, RVector<X> lhs, RVector<X> rhs) all.static <X extends RPrimitive>
booleanall.static <X extends RPrimitive>
booleanany(BiPredicate<X, X> tester, RVector<X> lhs, RVector<X> rhs) any.static <X extends RPrimitive>
booleanany.static RNumericType cast a Numeric to Integerstatic booleanChecks if is finite.static booleanisNa(RPrimitive x) Checks if is na.static RCharacterpaste(String sep, RPrimitive... objects) Paste0 implemenationstatic booleanprecisionEquals(RNumeric v1, RNumeric v2, Double epsilon) Precision equals for numerics.
-
Constructor Details
-
RFunctions
public RFunctions()
-
-
Method Details
-
asNumeric
Type cast a Numeric to Integer- Parameters:
i- RInteger Value- Returns:
- RNumeric with the same value
-
paste
Paste0 implemenation- Parameters:
sep- any separating stringobjects- the objects to join which will be converted using the toString of the underlying primitive- Returns:
- a String
-
all
public static <X extends RPrimitive> boolean all(BiPredicate<X, X> tester, RVector<X> lhs, RVector<X> rhs) all.
- Type Parameters:
X- - any R primitive type- Parameters:
tester- - a predicate of RPrimtive pairslhs- - the lhs RVectorrhs- - the rhs RVector- Returns:
- true if both vectors are either empty or all value pairs return true. false if the vectors are not the same length or any are false;
-
all
all.
- Type Parameters:
X- - any R primitive type- Parameters:
tester- - a predicate of RPrimtiveslhs- - the lhs RVector- Returns:
- true if all tests return true
-
any
public static <X extends RPrimitive> boolean any(BiPredicate<X, X> tester, RVector<X> lhs, RVector<X> rhs) any.
- Type Parameters:
X- - any R primitive type- Parameters:
tester- - a predicate of RPrimtive pairslhs- - the lhs RVectorrhs- - the rhs RVector- Returns:
- true if both vectors are either empty or all value pairs return true. false if the vectors are not the same length or any are false;
-
any
any.
- Type Parameters:
X- - any R primitive type- Parameters:
tester- - a predicate of RPrimtive pairslhs- - the lhs RVector- Returns:
- true if any tests return true
-
precisionEquals
Precision equals for numerics.- Parameters:
v1- the v1 of the comparisonv2- the v2 of the comparisonepsilon- the epsilon- Returns:
- true, if equal within
-
isNa
Checks if is na.- Parameters:
x- the x- Returns:
- true, if is na
-
isFinite
Checks if is finite.- Parameters:
x- the x- Returns:
- true, if is finite
-