Displaying 1 result from an estimated 1 matches for "integer_valu".
Did you mean:
integer_value
2006 Jul 26
1
.Call question
...e/type.
below is an example of the essence of the problem. This seems to work.
Is this dangerous or ok? (of course, I want to do something more
complicated
since I can do this in R, but I hope this illustrates my question).
SEXP modlist(SEXP list, SEXP ind, SEXP element){
int index;
index=INTEGER_VALUE(ind);
SET_ELEMENT(list,index,element);
return(ind);
}
called in R as in
lst=list("a","b","c")
element="d"
out=.Call("modlist",lst,1,element)
here the .Call is used just for its effect on lst.
thanks!
peter
.................................