public REXPList(RList list) { super(); payload=(list==null)?new RList():list; }
public REXPList(RList list, REXPList attr) { super(attr); payload=(list==null)?new RList():list; }
/** creates a new generic vector from a list. Note that the names in the list are ignored as they are expected to be defined by the attributes parameter. * @param list list to create the vector from (names are ignored - use {@link #REXPGenericVector(RList)} or the <code>"names"</code> attribute for named lists * @param attr attributes */ public REXPGenericVector(RList list, REXPList attr) { super(attr); payload=(list==null)?new RList():list; }
public REXPList(RList list, REXPList attr) { super(attr); payload=(list==null)?new RList():list; }
public RList asList() { return new RList(); } public Object asNativeJavaObject() { return null; }
/** creates a new generic vector from a list. Note that the names in the list are ignored as they are expected to be defined by the attributes parameter. * @param list list to create the vector from (names are ignored - use {@link #REXPGenericVector(RList)} or the <code>"names"</code> attribute for named lists * @param attr attributes */ public REXPGenericVector(RList list, REXPList attr) { super(attr); payload=(list==null)?new RList():list; }
public Object clone() { return new RList(this, names); }
public REXPList(RList list) { super(); payload=(list==null)?new RList():list; }
public REXPList(REXP value, String name) { super(); payload = new RList(new REXP[] { value }, new String[] { name }); }
public REXPList(REXP value, String name) { super(); payload = new RList(new REXP[] { value }, new String[] { name }); }
public static REXP asCall(REXP what, REXP arg1) { return new REXPLanguage(new RList(new REXP[] { what, arg1 })); } public static REXP asCall(REXP what, REXP arg1, REXP arg2) {
/** creates a new generic vector from a list. If the list is named, the <code>"names"</code> attribute is created automatically from it. * @param list list to create the vector from */ public REXPGenericVector(RList list) { super(); payload=(list==null)?new RList():list; // automatically generate 'names' attribute if (payload.isNamed()) attr = new REXPList( new RList(new REXP[] { new REXPString(payload.keys()) }, new String[] { "names" })); }
public static REXP asCall(String name, REXP arg1, REXP arg2) { return new REXPLanguage(new RList(new REXP[] { new REXPSymbol(name), arg1, arg2 })); } public static REXP asCall(String name, REXP arg1, REXP arg2, REXP arg3) {
/** creates a new generic vector from a list. If the list is named, the <code>"names"</code> attribute is created automatically from it. * @param list list to create the vector from */ public REXPGenericVector(RList list) { super(); payload=(list==null)?new RList():list; // automatically generate 'names' attribute if (payload.isNamed()) attr = new REXPList( new RList(new REXP[] { new REXPString(payload.keys()) }, new String[] { "names" })); }
public static REXP asCall(String name, REXP arg1) { return new REXPLanguage(new RList(new REXP[] { new REXPSymbol(name), arg1 })); } public static REXP asCall(String name, REXP arg1, REXP arg2) {
public static REXP asCall(REXP what, REXP[] args) { RList l = new RList(); l.add(what); for (int i = 0; i < args.length; i++) l.add(args[i]); return new REXPLanguage(l); } public static REXP asCall(String name, REXP[] args) {
/** create a new factor REXP * @param ids indices (one-based!) * @param levels levels */ public REXPFactor(int[] ids, String[] levels) { super(ids); this.levels = (levels==null)?(new String[0]):levels; factor = new RFactor(this.payload, this.levels, false, 1); attr = new REXPList( new RList( new REXP[] { new REXPString(this.levels), new REXPString("factor") }, new String[] { "levels", "class" })); }
/** create a new factor REXP * @param ids indices (one-based!) * @param levels levels */ public REXPFactor(int[] ids, String[] levels) { super(ids); this.levels = (levels==null)?(new String[0]):levels; factor = new RFactor(this.payload, this.levels, false, 1); attr = new REXPList( new RList( new REXP[] { new REXPString(this.levels), new REXPString("factor") }, new String[] { "levels", "class" })); }
/** create a new factor REXP from an existing RFactor * @param factor factor object (can be of any index base, the contents will be pulled with base 1) */ public REXPFactor(RFactor factor) { super(factor.asIntegers(1)); this.factor = factor; this.levels = factor.levels(); attr = new REXPList( new RList( new REXP[] { new REXPString(this.levels), new REXPString("factor") }, new String[] { "levels", "class" })); }
/** create a new factor REXP from an existing RFactor * @param factor factor object (can be of any index base, the contents will be pulled with base 1) */ public REXPFactor(RFactor factor) { super(factor.asIntegers(1)); this.factor = factor; this.levels = factor.levels(); attr = new REXPList( new RList( new REXP[] { new REXPString(this.levels), new REXPString("factor") }, new String[] { "levels", "class" })); }