[Rd] How to print UTF-8 encoded strings from a C routine to R's output?

2016-09-05 Thread Lixin Gong
Dear R experts, It seems that Rprintf has to be used to print from a C routine to guarantee to write to R’s output according to https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Printing. However if a string is UTF-8 encoded, non-ASCII characters (e.g., the infinity symbol http://www.f

Re: [Rd] How to print UTF-8 encoded strings from a C routine to R's output?

2016-09-05 Thread Duncan Murdoch
On 05/09/2016 12:40 AM, Lixin Gong wrote: Dear R experts, It seems that Rprintf has to be used to print from a C routine to guarantee to write to R’s output according to https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Printing. However if a string is UTF-8 encoded, non-ASCII charac

Re: [Rd] Defragmentation of memory

2016-09-05 Thread luke-tierney
On Mon, 5 Sep 2016, Måns Magnusson wrote: Dear all developers, I'm working with a lot of textual data in R and need to handle this batch by batch. The problem is that I read in batches of 10 000 documents and do some calculations that results in objects that consume quite some memory (calculate

Re: [Rd] How to print UTF-8 encoded strings from a C routine to R's output?

2016-09-05 Thread Lixin Gong
Hi Duncan, Thanks a lot for your quick reply pointing out the Re-encoding section that I missed! Before trying out R's C-level interface to the iconv's encoding conversion capabilities, I did some quick tests with Encoding() and iconv() on Windows with Rgui and Rterm. After Encoding(), non-ASCII

[Rd] mget call can trigger C stack usage error

2016-09-05 Thread Alexandre Courtiol
Hi all, not sure if you will call this a bug or something else but the following silly call trigger a low level error: foo <- list(x=1) class(foo) <- "new" print.new <- function(x, ...) print(mget(names(formals( foo > Error: C stack usage 7969412 is too close to the limit -- Alexandre Co

Re: [Rd] A bug in the R Mersenne Twister (RNG) code?

2016-09-05 Thread Martin Maechler
> Gabriel Becker > on Thu, 1 Sep 2016 08:34:31 -0700 writes: > I wonder how useful a (set of?) "time machine" functions > which look up /infer things like this based on a date > would be. Could ease the pain of changes generally, though > not remove it completely. Suc