Displaying 2 results from an estimated 2 matches for "myinteger".
2012 Sep 15
1
Question about copying arguments in C.
...t be an integer.");
if(constructThingy(INTEGER(thingysInteger)[0])) error("error in
getting a thingy");
TClass = MAKE_CLASS("thingy");
PROTECT(ans = NEW_OBJECT(TClass));
// *****QUESTION STARTS HERE*****
// CAN I SAY:
SET_SLOT(ans, Rf_install("myInteger"), thingysInteger);
// IF NOT, CAN I SAY
SET_SLOT(ans, Rf_install("myInteger"), AS_INTEGER(thingysInteger));
// OR DO I NEED TO SAY
PROTECT(ti = allocVector(INTSXP, 1)); INTEGER(pns)[0] =
INTEGER(thingysInteger)[0];
SET_SLOT(ans, Rf_install("myInteger"...
2002 Jan 09
0
methods: Extending classes
...I get the following error:
> m3 <- new("Matrix", 1)
Error in asMethod(object, Class, value) : unused argument(s) ( ...)
or
> m2 <- new("Matrix", matrix(1))
Error in asMethod(object, Class, value) : unused argument(s) ( ...)
I also tried to declare a class MyInteger that extends the class integer,
but the same errors:
> setClass("MyInteger", representation("integer"))
> i1 <- new("MyInteger")
> i2 <- new("MyInteger", 3)
Error in asMethod(object, Class, value) : unused argument(s) ( ...)
> i3...