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

2013-06-27 Thread Ben Bolker
-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 lm(), used when one wants to pass all of the

Re: [Rd] Error on executing functions from installed package

2013-06-27 Thread Hervé Pagès
Hi Kamal, Sounds like a Bioconductor question. Would be better to ask on the Bioc-devel mailing list. See you there. Cheers, H. On 06/26/2013 07:37 AM, Kamal wrote: Few more details: clRes object is essentially a list of SummarizedExperiment class object (of GenomicRanges package). Each obje

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

2013-06-27 Thread Hervé Pagès
Hi Ge, Here is one way to do this with the Biostrings C API. It does 2 passes on the file. There is also a 1-pass way but not necessarily worth it because not as memory efficient. The code below is untested (not even guaranteed to compile)! SEXP read_text_file_in_BStringSet(FILE *FN) { SEXP

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

2013-06-27 Thread Simon Urbanek
On Jun 27, 2013, at 3:37 PM, Ge Tan wrote: > Hi Simons, > > Thanks for your reply. > 1 is just an example I wrote. In fact, there can be millions of strings > (all of them are different and each has thousands of characters) I want to > read from the file. So if I use mkChar it will store t

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

2013-06-27 Thread Ge Tan
Hi Simons, Thanks for your reply. 1 is just an example I wrote. In fact, there can be millions of strings (all of them are different and each has thousands of characters) I want to read from the file. So if I use mkChar it will store the same amount of the copies in the global cache. The pr

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

2013-06-27 Thread Simon Urbanek
On Jun 27, 2013, at 9:18 AM, Ge Tan wrote: > Hi, > > I want to read a text file into R with .Call(). > So I define some NEW_CHARACTER() to store the chracters read and use > SET_STRING_ELT to fill the elements. > > e.g. > PROTECT(qNames = NEW_CHARACTER(1)); > char *foo; // This foo holds t

Re: [Rd] pretty eerie feeling: Google "down", Twitter "down", R sites up

2013-06-27 Thread Martin Maechler
> Marc Schwartz > on Thu, 27 Jun 2013 11:26:23 -0500 writes: > On Jun 27, 2013, at 10:32 AM, Martin Maechler wrote: >> Maybe this is just from inside ETH Zurich, >> but I haven't seen this before in many years: >> for > 15 minutes now, for me and at least someone e

Re: [Rd] pretty eerie feeling: Google "down", Twitter "down", R sites up

2013-06-27 Thread Marc Schwartz
On Jun 27, 2013, at 10:32 AM, Martin Maechler wrote: > Maybe this is just from inside ETH Zurich, > but I haven't seen this before in many years: > for > 15 minutes now, for me and at least someone else here, > > - Google (incl. Gmail, calendar..) is entirely unreachable > - Twitter is "conne

[Rd] pretty eerie feeling: Google "down", Twitter "down", R sites up

2013-06-27 Thread Martin Maechler
Maybe this is just from inside ETH Zurich, but I haven't seen this before in many years: for > 15 minutes now, for me and at least someone else here, - Google (incl. Gmail, calendar..) is entirely unreachable - Twitter is "connecting" and is not reached (in the browser), - three major Swiss news

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

2013-06-27 Thread Ge Tan
Hi, I want to read a text file into R with .Call(). So I define some NEW_CHARACTER() to store the chracters read and use SET_STRING_ELT to fill the elements. e.g. PROTECT(qNames = NEW_CHARACTER(1)); char *foo; // This foo holds the string I want. while(foo = readLine(FN)){ SET_STRING_ELT(q

Re: [Rd] Error on executing functions from installed package

2013-06-27 Thread Henrik Singmann
Hi Kamal, I suspect this to be because you did not load the package on each core so the S4 definitions are not available there. The solution would be to specifically load the library at each core prior to calling clusterApplyLB. (I vaguely remember once having a similar problem where something