[R-pkg-devel] Adding non-exported functions in an extra environment in new S4 object

2016-01-21 Thread Rainer M Krug
Hi I have a package named asm which contains many non-exported functions which are all starting with "for.eq.". I also have an S4 class ASM which, when a new object asm of class ASM is created by using the function newASM() (in the package asm) contains among other slots one sot with an environme

Re: [R-pkg-devel] Adding non-exported functions in an extra environment in new S4 object

2016-01-21 Thread Rainer M Krug
Rainer M Krug writes: > Hi > > I have a package named asm which contains many non-exported functions > which are all starting with "for.eq.". > > I also have an S4 class ASM which, when a new object asm of class ASM is > created by using the function newASM() (in the package asm) contains > among

[R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Tom Quarendon
I would like to implement a package that contains a C function that writes to a connection. So the R_ext/Connections.h defines what a connection IS, but not how to get one. What seems to work is to manually declare Rconnection getConnection(int n); In my C file, and while this works, and I can th

Re: [R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Duncan Murdoch
On 21/01/2016 11:39 AM, Tom Quarendon wrote: I would like to implement a package that contains a C function that writes to a connection. So the R_ext/Connections.h defines what a connection IS, but not how to get one. What seems to work is to manually declare Rconnection getConnection(int n); I

Re: [R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Tom Quarendon
But that's what I want to do, create the connection in R code and pass it on to the C function. My question is, how do I do that? You appear to need the C getConnection entry point, but it's not part of the API. So I'm wondering how I'm supposed to do what you describe. Sorry if I was unclear.

Re: [R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Tom Quarendon
But that's what I want to do, create the connection in R code and pass it on to the C function. My question is, how do I do that? You appear to need the C getConnection entry point, but it's not part of the API. So I'm wondering how I'm supposed to do what you describe. Sorry if I was unclear.

Re: [R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Duncan Murdoch
On 21/01/2016 12:50 PM, Tom Quarendon wrote: But that's what I want to do, create the connection in R code and pass it on to the C function. My question is, how do I do that? You appear to need the C getConnection entry point, but it's not part of the API. So I'm wondering how I'm supposed to d

Re: [R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Tom Quarendon
So upshot is that I can only do why I want by using the function that's not part of the api, or just not using connections at all and just using normal C file io, opened from C, and simply pass the file name in instead, rather than a proper connection object? > On 21 Jan 2016, at 6:04 pm, Dunca

Re: [R-pkg-devel] How to pass a connection into a C function (R 3.2)

2016-01-21 Thread Duncan Murdoch
On 21/01/2016 1:07 PM, Tom Quarendon wrote: So upshot is that I can only do why I want by using the function that's not part of the api, or just not using connections at all and just using normal C file io, opened from C, and simply pass the file name in instead, rather than a proper connectio