Re: [Bioc-devel] [Rd] Read a text file into R with .Call()

2013-06-28 Thread Hervé Pagès
Hi Ge, On 06/28/2013 04:45 AM, Ge Tan wrote: Hi Hervé, Thank you so much!!! I tweaked it a little and it works exactly in the Biostrings way which I want to learn! You are my idol!! One minor question I want to ask is when I change the alloc_XRawList(BStringSet, BString, ans_width)); to

Re: [Rd] How can C++ read the R object written into socket with saveRDS or save

2013-06-28 Thread Rong lI Li
Hi, all, Many thanks for your suggestions/infos! For my previous question: how to get the size of R object, so that the C++ process can know exact bytes to read, and receive the R objectvia socket connection, for now, I used the following way to achieve this. It worked for me. Pls feel free to

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Peter Meilstrup
On Thu, Jun 27, 2013 at 8:49 PM, Ben Bolker bbol...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The lmer() function in the lme4 package has some code of the form mc - match.call() mc[[1]] - as.name(lFormula) lmod - eval(mc, parent.frame(1L)) this is a fairly

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Duncan Murdoch
On 13-06-27 11:49 PM, Ben Bolker wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The lmer() function in the lme4 package has some code of the form mc - match.call() mc[[1]] - as.name(lFormula) lmod - eval(mc, parent.frame(1L)) this is a fairly common idiom in R, found e.g. in

[Rd] 'modifyList' drops (not adds) NULL components

2013-06-28 Thread Raubertas, Richard
Dear list, Utils::modifyList() drops NULL components in its second argument, instead of adding them to the first argument. Compare: modifyList(x=list(A=1), val=list(B=2, C=3)) $A [1] 1 $B [1] 2 $C [1] 3 modifyList(x=list(A=1), val=list(B=NULL, C=3)) $A [1] 1 $C [1] 3 To me this seems

Re: [Rd] 'modifyList' drops (not adds) NULL components

2013-06-28 Thread Deepayan Sarkar
On Thu, Jun 27, 2013 at 10:59 PM, Raubertas, Richard richard_rauber...@merck.com wrote: Dear list, Utils::modifyList() drops NULL components in its second argument, instead of adding them to the first argument. Compare: modifyList(x=list(A=1), val=list(B=2, C=3)) $A [1] 1 $B [1] 2 $C

Re: [Rd] 'modifyList' drops (not adds) NULL components

2013-06-28 Thread Raubertas, Richard
See response inline below. -Original Message- From: Deepayan Sarkar [mailto:deepayan.sar...@gmail.com] Sent: Friday, June 28, 2013 7:17 AM To: Raubertas, Richard Cc: R-devel@r-project.org Subject: Re: [Rd] 'modifyList' drops (not adds) NULL components On Thu, Jun 27, 2013 at

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Ben Bolker
Duncan Murdoch murdoch.duncan at gmail.com writes: [snip] The other choice is to use the explicit ::, i.e. mc[[1]] - quote(lmer::lFormula) This would be the solution I'd prefer, but you seem to have some prejudice against :: . I just thought that the whole point of using the

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Duncan Murdoch
On 28/06/2013 12:42 PM, Ben Bolker wrote: Duncan Murdoch murdoch.duncan at gmail.com writes: [snip] The other choice is to use the explicit ::, i.e. mc[[1]] - quote(lmer::lFormula) This would be the solution I'd prefer, but you seem to have some prejudice against :: . I just

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread peter dalgaard
On Jun 28, 2013, at 18:42 , Ben Bolker wrote: Duncan Murdoch murdoch.duncan at gmail.com writes: [snip] The other choice is to use the explicit ::, i.e. mc[[1]] - quote(lmer::lFormula) This would be the solution I'd prefer, but you seem to have some prejudice against :: .

Re: [Rd] Read a text file into R with .Call()

2013-06-28 Thread Hervé Pagès
Hi Ge, On 06/28/2013 04:45 AM, Ge Tan wrote: Hi Hervé, Thank you so much!!! I tweaked it a little and it works exactly in the Biostrings way which I want to learn! You are my idol!! One minor question I want to ask is when I change the alloc_XRawList(BStringSet, BString, ans_width)); to

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Ben Bolker
On 13-06-28 01:56 PM, Duncan Murdoch wrote: On 28/06/2013 12:42 PM, Ben Bolker wrote: Duncan Murdoch murdoch.duncan at gmail.com writes: [snip] The other choice is to use the explicit ::, i.e. mc[[1]] - quote(lmer::lFormula) This would be the solution I'd prefer, but you seem to

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Ben Bolker
On 13-06-28 03:57 PM, Peter Meilstrup wrote: Well, once you begin messing with eval.parent(), you _are_ telling R what environment to work in, and things have the potential to go wrong at that point because you're telling R to work in environment you don't know anything about. Having to be

Re: [Rd] problem with eval(..., parent.frame(1L)) when package is not loaded

2013-06-28 Thread Peter Meilstrup
On Fri, Jun 28, 2013 at 3:07 PM, Ben Bolker bbol...@gmail.com wrote: On 13-06-28 03:57 PM, Peter Meilstrup wrote: Well, once you begin messing with eval.parent(), you _are_ telling R what environment to work in, and things have the potential to go wrong at that point because you're telling