Package org.renjin.sexp

Examples of org.renjin.sexp.SEXP


    super(".Internal");
  }

  @Override
  public SEXP apply(Context context, Environment rho, FunctionCall call, PairList args) {
    SEXP arg = call.getArgument(0);
    assert arg!=null;
    if(!(arg instanceof FunctionCall)) {
      throw new EvalException("invalid .Internal() argument");
    }
    FunctionCall internalCall = (FunctionCall) arg;
    Symbol internalName = (Symbol)internalCall.getFunction();
    SEXP function = Primitives.getInternal(internalName);
    if(function==null || function == Null.INSTANCE) {
      throw new EvalException(String.format("no internal function \"%s\"", internalName.getPrintName()));
    }
    return ((Function)function).apply(context, rho, internalCall, internalCall.getArguments());
  }
View Full Code Here


    super("if");
  }

  @Override
  public SEXP apply(Context context, Environment rho, FunctionCall call, PairList args) {
    SEXP condition = context.evaluate( call.getArguments().getElementAsSEXP(0), rho);

    // force any deferred operations
    condition = context.materialize(condition);

    if (asLogicalNoNA(context, call, condition)) {
View Full Code Here

  public SEXP apply(Context context, Environment rho, FunctionCall call, PairList args) {
    if(args == Null.INSTANCE) {
      context.setInvisibleFlag();
      return Null.INSTANCE;
    } else {
      SEXP lastResult = Null.INSTANCE;
      for (SEXP sexp : call.getArguments().values()) {
        lastResult = context.evaluate( sexp, rho);
      }
      return lastResult;
    }
View Full Code Here

TOP

Related Classes of org.renjin.sexp.SEXP

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.