Re: [Rd] A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Saptarshi Guha
Hello Simon, Thanks much for the replies. It makes sense now and I'm on the right track. I'll explain why this might happen. I've written a package caller rterra [1] which essentially allows the R user to write extensions in Lua. The extensions are JIT compiled via LuaJIT. For deterministic perfo

Re: [Rd] A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Simon Urbanek
On Mar 6, 2014, at 5:32 PM, Saptarshi Guha wrote: > Hello, > > This is a question that probably reveals my lack of understanding. > In a C function (call it cfunc), i created a SEXP, called S, and then > called R_PreserveObject on S. > > I returned the SEXP to the calling R function (call it r

Re: [Rd] A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Gabriel Becker
Saptarshi, a will be protected throughout the entirety of any r functions you call in the loop. Do you have evidence that this is not the case? The protect stack is last on first off, so assuming balance, even if UNPROTECT() is called underneath the R functions you are calling, it won't touch a,

[Rd] Many apologies: last post: A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Saptarshi Guha
Apologies, I am resending this because my emails seem to go in HTML form. (I haven't as yet figured gmail web interface) Hello, This is a question that probably reveals my lack of understanding. In a C function (call it cfunc), i created a SEXP, called S, and then called R_PreserveObject on S.

[Rd] Repost: (apologies for HTML post) A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Saptarshi Guha
Apologies, I am resending this because my emails seem to go in HTML form. Hello, This is a question that probably reveals my lack of understanding. In a C function (call it cfunc), i created a SEXP, called S, and then called R_PreserveObject on S. I returned the SEXP to the calling R function

Re: [Rd] A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Saptarshi Guha
Hello, However, I do need some sort of protection. (pseudo code) SEXP a = Rf_allocVector(STRSXP,) protect a for i = 1 to length of vector SET_STRING_ELT(a,i, Rf_mkChar(...)) end unprotect a return a I _need _that protect because in the for loop i also call some R functions and need the obj

Re: [Rd] A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Gabriel Becker
Saptarshi, R_PreserveObject and R_ReleaseObject are, as far as I know, intended for the rare situations where you need to maintain a SEXP in C that is not pointed to by any R level symbols, and across e.g. .Calls. If you are returning an object to R ("v" in this case) and intend to do .Call("cfun

[Rd] A question about multiple(?) out of order ReleaseObject

2014-03-06 Thread Saptarshi Guha
Hello, This is a question that probably reveals my lack of understanding. In a C function (call it cfunc), i created a SEXP, called S, and then called R_PreserveObject on S. I returned the SEXP to the calling R function (call it rfunc). Note, I didn't call R_ReleaseObject on S. v <- .Call("cfun

Re: [Rd] version numbers for CRAN submissions that give warnings/notes

2014-03-06 Thread Prof Brian Ripley
On 06/03/2014 20:22, Duncan Murdoch wrote: On 06/03/2014 2:39 PM, Michael Friendly wrote: It often happens that I submit a new revision of a package, say mypkg-1.0-10, from R-Forge to CRAN after running R CMD check locally and looking at the log files on R-Forge. But R-Forge has the devel checks

Re: [Rd] version numbers for CRAN submissions that give warnings/notes

2014-03-06 Thread Duncan Murdoch
On 06/03/2014 2:39 PM, Michael Friendly wrote: It often happens that I submit a new revision of a package, say mypkg-1.0-10, from R-Forge to CRAN after running R CMD check locally and looking at the log files on R-Forge. But R-Forge has the devel checks disabled, and I get an email from CRAN poin

Re: [Rd] makepredictcall

2014-03-06 Thread Prof Brian Ripley
See the developer site, e.g. http://developer.r-project.org/model-fitting-functions.txt . That is where specialized info is (and this is specialized). On 06/03/2014 18:19, Therneau, Terry M., Ph.D. wrote: An issue came up with the rms package today that makepredictcall would solve, and I was g

Re: [Rd] Create dataframe in C from table and return to R

2014-03-06 Thread Duncan Murdoch
On 06/03/2014 1:47 PM, Sandip Nandi wrote: Hi , I am trying to create a dataframe in C and sebd it back to R. Can anyone point me to the part of the source code where it is doing , let me explain the problem I am having . My

[Rd] version numbers for CRAN submissions that give warnings/notes

2014-03-06 Thread Michael Friendly
It often happens that I submit a new revision of a package, say mypkg-1.0-10, from R-Forge to CRAN after running R CMD check locally and looking at the log files on R-Forge. But R-Forge has the devel checks disabled, and I get an email from CRAN pointing out some new warning or note I'm asked t

[Rd] Create dataframe in C from table and return to R

2014-03-06 Thread Sandip Nandi
Hi , I am trying to create a dataframe in C and sebd it back to R. Can anyone point me to the part of the source code where it is doing , let me explain the problem I am having . My simple implementation is like this SEXP for

[Rd] makepredictcall

2014-03-06 Thread Therneau, Terry M., Ph.D.
An issue came up with the rms package today that makepredictcall would solve, and I was going to suggest it to the author. But looking in the help documents I couldn't find any reference to it. There is a manual page, but it does not give much aid in creating code for a new transformation func

Re: [Rd] [GSoC student proposal] Implementation of Modified Weibull-G Family Distribution in R

2014-03-06 Thread Ben Bolker
Dr M Aleem gmail.com> writes: > > Dear Brian and R team, > > I am Dr. Aleem and I want to participate as a student in GSoC 2014 in the > development of R. I have extensive experience in Statistical research and > development and I am a student of advanced statistics applications. I > strongly b

Re: [Rd] 'parallel' package changes '.Random.seed'

2014-03-06 Thread Prof Brian Ripley
On 06/03/2014 10:17, Henric Winell wrote: Hi, I've implemented parallelization in one of my packages using the 'parallel' package -- many thanks for providing it! In my package I'm importing 'parallel' and so added it to the DESCRIPTION file's 'Import:' tag and also added a 'importFrom("paralle

Re: [Rd] 'parallel' package changes '.Random.seed'

2014-03-06 Thread Henric Winell
Comments below. On 2014-03-06 11:17, Henric Winell wrote: Hi, I've implemented parallelization in one of my packages using the 'parallel' package -- many thanks for providing it! In my package I'm importing 'parallel' and so added it to the DESCRIPTION file's 'Import:' tag and also added a 'im

[Rd] 'parallel' package changes '.Random.seed'

2014-03-06 Thread Henric Winell
Hi, I've implemented parallelization in one of my packages using the 'parallel' package -- many thanks for providing it! In my package I'm importing 'parallel' and so added it to the DESCRIPTION file's 'Import:' tag and also added a 'importFrom("parallel", ...)' statement in the NAMESPACE fi