Class RFunctions

java.lang.Object
uk.co.terminological.rjava.utils.RFunctions

public class RFunctions extends Object

RFunctions class.

Version:
$Id: $Id
Author:
vp22681
  • Constructor Details

    • RFunctions

      public RFunctions()
  • Method Details

    • asNumeric

      public static RNumeric asNumeric(RInteger i)
      Type cast a Numeric to Integer
      Parameters:
      i - RInteger Value
      Returns:
      RNumeric with the same value
    • paste

      public static RCharacter paste(String sep, RPrimitive... objects)
      Paste0 implemenation
      Parameters:
      sep - any separating string
      objects - 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 pairs
      lhs - - the lhs RVector
      rhs - - 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

      public static <X extends RPrimitive> boolean all(Predicate<X> tester, RVector<X> lhs)

      all.

      Type Parameters:
      X - - any R primitive type
      Parameters:
      tester - - a predicate of RPrimtives
      lhs - - 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 pairs
      lhs - - the lhs RVector
      rhs - - 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

      public static <X extends RPrimitive> boolean any(Predicate<X> tester, RVector<X> lhs)

      any.

      Type Parameters:
      X - - any R primitive type
      Parameters:
      tester - - a predicate of RPrimtive pairs
      lhs - - the lhs RVector
      Returns:
      true if any tests return true
    • precisionEquals

      public static boolean precisionEquals(RNumeric v1, RNumeric v2, Double epsilon)
      Precision equals for numerics.
      Parameters:
      v1 - the v1 of the comparison
      v2 - the v2 of the comparison
      epsilon - the epsilon
      Returns:
      true, if equal within
    • isNa

      public static boolean isNa(RPrimitive x)
      Checks if is na.
      Parameters:
      x - the x
      Returns:
      true, if is na
    • isFinite

      public static boolean isFinite(RNumeric x)
      Checks if is finite.
      Parameters:
      x - the x
      Returns:
      true, if is finite