Examples of FunctionCall


Examples of org.renjin.sexp.FunctionCall

    if(f_env != Null.INSTANCE) {
      args.add(f_env);
    }

    try {
      return context.evaluate(new FunctionCall(s_MethodsListSelect, args.build()), methodsNamespace);
    } catch(EvalException e) {
      throw new EvalException(String.format("S language method selection got an error when called from" +
          " internal dispatch for function '%s'", fname), e);
    }
  }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

       "loadMethod", which would produce a recursive loop */
    if(fname.equals("loadMethod")) {
      return def;
    }
    if(found < attrib.length()) {
      FunctionCall call = FunctionCall.newCall(R_loadMethod_name, def, StringArrayVector.valueOf(fname), ev);
      return context.evaluate(call, ev);

      //      SEXP e, val;
      //      PROTECT(e = allocVector(LANGSXP, 4));
      //      SETCAR(e, R_loadMethod_name); val = CDR(e);
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

       the current sysparent. */
    Environment callerenv = cptr.getCallingEnvironment(); /* or rho? */

    /* get the rest of the stuff we need from the current context,
       execute the method, and return the result */
    FunctionCall call = cptr.getCall();
    PairList arglist = cptr.getArguments();
    SEXP val = R_execClosure(context, call, op, arglist, callerenv, newrho);
    return val;
  }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

    // create dummy fcall
    PairList.Builder args = new PairList.Builder();
    for(Expression argument : arguments) {
      args.add(StringVector.valueOf(argument.toString()));
    }
    return new PrimitiveCall(new FunctionCall(Symbol.get(fnName), args.build()), fnName, arguments);
  }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

    eval("x <- bquote(~0 + .(quote(births)))");
    eval("print(x)");

    // expected : ~0 + births
   
    FunctionCall tildeCall = (FunctionCall) topLevelContext.getGlobalEnvironment().getVariable("x");
    assertThat(tildeCall.getFunction(), equalTo((SEXP)symbol("~")));   
    assertThat(tildeCall.getArguments().length(), equalTo(1));
   
    FunctionCall plusCall = (FunctionCall)tildeCall.getArgument(0);
    assertThat(plusCall.getFunction(), equalTo((SEXP)symbol("+")));   
  }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

      this.context = context;
    }

    @Override
    public void visit(FunctionCall call) {
      result = new FunctionCall(
          substitute(call.getFunction()),
          substituteArgumentList(call.getArguments()),
          call.getAttributes()
      );
    }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

    PairList.Builder args = new PairList.Builder();
    args.add(StringVector.valueOf(dataFile.getAbsolutePath()));
    args.add("header", LogicalVector.TRUE);
    args.add("sep", StringVector.valueOf(sep));

    FunctionCall readTable = FunctionCall.newCall(Symbol.get("::"), Symbol.get("utils"), Symbol.get("read.table"));
    FunctionCall call = new FunctionCall(readTable, args.build());

    Session session = new SessionBuilder().build();
    SEXP dataFrame = session.getTopLevelContext().evaluate(call);

    PairList.Builder pairList = new PairList.Builder();
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

    if(specials != Null.INSTANCE) {
      attributes.set("specials", buildSpecials((AtomicVector)specials));
    }
   
    // create an new Function Call 
    FunctionCall copy = x.clone();
    return copy.setAttributes(attributes.build());
  }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

    if(argument instanceof Symbol) {
      list.add(new Term(argument));
    } else if(argument instanceof Vector) {
      intercept((Vector)argument, subtracting);
    } else if(argument instanceof FunctionCall) {
      FunctionCall call = (FunctionCall)argument;
      if(call.getFunction() == UNION) {
        unionTerms(list, call);
      } else if(call.getFunction() == EXPAND_TERMS) {
        multiply(list, call);
      } else if(call.getFunction() == DIFFERENCE) {
        difference(list, call);
      } else if(call.getFunction() == GROUP) {
        add(list, call.getArgument(0), subtracting);
      } else {
        list.add(new TermBuilder().build(call));
      }
    }
  }
View Full Code Here

Examples of org.renjin.sexp.FunctionCall

    // class(x$a[3]) <- "foo"

    SEXP lhs = assignment.getArgument(0);
   
    while(lhs instanceof FunctionCall) {
      FunctionCall call = (FunctionCall) lhs;
     
      rhs = builder.translateSetterCall(context, call, rhs);
      lhs = call.getArgument(0);
    }

    LValue target;
    if( lhs instanceof Symbol) {
      target = new EnvironmentVariable((Symbol) lhs);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.