Package adams.core

Class RObjectHelper


  • public class RObjectHelper
    extends Object
    Helper class for common R object operations.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • RObjectHelper

        public RObjectHelper()
    • Method Detail

      • getDimensions

        public static int[] getDimensions​(org.renjin.sexp.SEXP obj)
        Returns the dimensions of the object.
        Parameters:
        obj - the object to get the dimensions for
        Returns:
        the dimensions
      • getDimensionNames

        public static String[] getDimensionNames​(org.renjin.sexp.SEXP obj,
                                                 int dim)
        Returns the dimension names for the specified dimension.
        Parameters:
        obj - the object to get the dimension names for
        dim - the dimension index (0-based)
        Returns:
        the names, null if failed to obtain
      • vectorToStringArray

        public static String[] vectorToStringArray​(org.renjin.sexp.Vector v)
        Turns the vector into a string array.
        Parameters:
        v - the vector to convert
        Returns:
        the string array