Re: [Rd] SEXPs and slots

2010-11-16 Thread Simon Urbanek
On Nov 16, 2010, at 8:52 PM, Patrick Leyshock wrote: > Revisiting the output below: > > 1. Am I correct in thinking that the @XXX items are addresses? yes > 2. What are the meanings of the gXcX items? you should not worry about those - they are internal flags related to the garbage co

Re: [Rd] SEXPs and slots

2010-11-16 Thread Patrick Leyshock
Revisiting the output below: 1. Am I correct in thinking that the @XXX items are addresses? 2. What are the meanings of the gXcX items? 3. Does one ever see NAM[0]? Thanks, Patrick > .Internal(inspect(eg)) > @df70e48 25 S4SXP g0c0 [OBJ,NAM(2),gp=0x10,ATT] > ATTRIB: > @df70ef0 02 LISTSXP

Re: [Rd] SEXPs and slots

2010-11-15 Thread Patrick Leyshock
Thanks Martin and Hadley, this is very helpful. I should also add that I'm constantly reading the source code, but sometimes a response like this one can eliminate many, many hours of puzzlement. Much appreciated. Patrick On Mon, Nov 15, 2010 at 12:07 PM, Patrick Leyshock wrote: > Thanks Marti

Re: [Rd] SEXPs and slots

2010-11-15 Thread Patrick Leyshock
Thanks Martin and Hadley, this is very helpful. I should also add that I'm constantly reading the source code, but sometimes a response like this one can eliminate many, many hours of puzzlement. Much appreciated. Patrick On Mon, Nov 15, 2010 at 10:01 AM, Martin Morgan wrote: > On 11/15/2010

Re: [Rd] SEXPs and slots

2010-11-15 Thread Martin Morgan
On 11/15/2010 07:45 AM, Patrick Leyshock wrote: > Very helpful, thank you. > > A couple other questions, please: > > 1. I've got a function written in C, named "my_c_function". In my R > code I call this function, passing to it an INTSXP and a STRSXP, > respectively: > >result <- .Call("my

Re: [Rd] SEXPs and slots

2010-11-15 Thread Dirk Eddelbuettel
On 15 November 2010 at 10:46, Hadley Wickham wrote: | > 2.  Any good references/resources for developing R?  Nearly all the | > documents I've found are for programming R as a user, not as a developer.  I | > have copies of the documentation, which are very helpful, but it'd be | > helpful to have

Re: [Rd] SEXPs and slots

2010-11-15 Thread Hadley Wickham
> 2.  Any good references/resources for developing R?  Nearly all the > documents I've found are for programming R as a user, not as a developer.  I > have copies of the documentation, which are very helpful, but it'd be > helpful to have additional resources to fill in their gaps. The best advice

Re: [Rd] SEXPs and slots

2010-11-15 Thread Patrick Leyshock
Very helpful, thank you. A couple other questions, please: 1. I've got a function written in C, named "my_c_function". In my R code I call this function, passing to it an INTSXP and a STRSXP, respectively: result <- .Call("my_c_function", int_vector, str_vector) The prototype of "my_c_func

Re: [Rd] SEXPs and slots

2010-11-12 Thread Martin Morgan
On 11/12/2010 02:31 PM, Patrick Leyshock wrote: > Hello, > > I've created this class: > > setClass("example", >representation ( > size = "numeric", > id= "character" >) > ) > > Suppose I create a new instance of this class: > >> x <- new("example", 4, "id_value"

[Rd] SEXPs and slots

2010-11-12 Thread Patrick Leyshock
Hello, I've created this class: setClass("example", representation ( size = "numeric", id= "character" ) ) Suppose I create a new instance of this class: > x <- new("example", 4, "id_value") This creates an S4 object with two slots. Am I correct in thinking that