Re: [Rd] weird dir() behavior with broken symlinks

2016-10-18 Thread Karl Forner
#x27;) [1] TRUE > list.dirs(recursive=FALSE) [1] "./broken.txt" On Tue, Oct 18, 2016 at 3:08 PM, Karl Forner wrote: > I encountered very weird behavior of the dir() function, that I just can > not understand. > > Reproducible example: > > docker run -ti rocker/r-ba

[Rd] weird dir() behavior with broken symlinks

2016-10-18 Thread Karl Forner
I encountered very weird behavior of the dir() function, that I just can not understand. Reproducible example: docker run -ti rocker/r-base R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) > # s

[Rd] mcparallel (parallel:::mcexit) does not call finalizers

2016-06-16 Thread Karl Forner
not called). I was wondering if a modification of the parallel mcexit could be considered, to make it call the finalizers, possibly triggered by a parameter or an option, or if there are solid reasons not to do so. Regards, Karl Forner [[alternative HTML version dele

[Rd] MAX_NUM_DLLS too low ?

2015-05-08 Thread Karl Forner
dDLLs()))' gives 28 loaded DLLs. I am currently trying to work-around that by putting external packages in Suggests: instead of Imports:, and lazy-load them, but still I am wondering if that threshold value of 100 is still relevant nowadays, or would it be possible to increase it. Thanks, K

Re: [Rd] isOpen() misbehaviour

2014-06-19 Thread Karl Forner
t, I've used > isOpen() only in combination with the argument rw. > >> con <- file("clipboard",open="r") >> isOpen(con,"write") > [1] FALSE > > cheers > > > On Thu, Jun 19, 2014 at 3:10 PM, Karl Forner wrote: >> >> H

[Rd] isOpen() misbehaviour

2014-06-19 Thread Karl Forner
Hello, >From the doc, it says: "isOpen returns a logical value, whether the connection is currently open." But actually it seems to die on closed connections: > con <- file() > isOpen(con) [1] TRUE > close(con) > isOpen(con) Error in isOpen(con) : invalid connection Is it expected ? Tested on R

Re: [Rd] regression bug with getParseData and/or parse in R-3.1.0

2014-06-12 Thread Karl Forner
1 11 1 7 '{' TRUE{ 2 12 12 2 3 NUM_CONST TRUE1 3 12 12 3 7 exprFALSE 4 13 13 4 7 '}' TRUE} Karl On Thu, Jun 12, 2014 at 2:39 PM, Duncan Murdoch wrote:

[Rd] regression bug with getParseData and/or parse in R-3.1.0

2014-06-12 Thread Karl Forner
Hi, With R-3.1.0 I get: > getParseData(parse(text = "{1}", keep.source = TRUE)) line1 col1 line2 col2 id parent token terminal text 7 11 13 7 9 exprFALSE 1 11 11 1 7 '{' TRUE{ 2 12 12 2 3 NUM_CONST T

Re: [Rd] Rjulia: a package for R call Julia through Julia C API

2014-06-06 Thread Karl Forner
Excellent. By any chance are you aware of a julia way to perform the opposite: call R from julia ? Thanks On Fri, Jun 6, 2014 at 7:23 AM, Yu Gong wrote: > hello everyone,recently I write a package for R call Julia through Julia C > API > https://github.com/armgong/RJulia > now the package can d

Re: [Rd] Fwd: [RFC] A case for freezing CRAN

2014-03-21 Thread Karl Forner
On Fri, Mar 21, 2014 at 6:27 PM, Gábor Csárdi wrote: > On Fri, Mar 21, 2014 at 12:40 PM, Karl Forner wrote: > [...] > >> Hmm, what if your package depends on packages A and B, and that A depends >> on C v1.0 and B depends on C v1.1 ? This is just an example but I imagine &

Re: [Rd] Fwd: [RFC] A case for freezing CRAN

2014-03-21 Thread Karl Forner
> On Fri, Mar 21, 2014 at 12:08 PM, Karl Forner wrote: > [...] > > - "exact deps versions": >> will put a lot of burden of the developer. >> > > Not really, in my opinion, if you have the proper tools. Most likely when > you develop any given version

[Rd] Fwd: [RFC] A case for freezing CRAN

2014-03-21 Thread Karl Forner
p them consistent because the installed version depends on the moment you perform the install.packages(). So I second the Jeroen proposal to have a snapshot of packages versions tied to a given R version, well tested altogether. This implies as stated by Herve to keep all package source versions, and will

Re: [Rd] [PATCH] Code coverage support proof of concept

2014-03-07 Thread Karl Forner
Here's an updated version of the patch that fixes a stack imbalance bug. N.B: the patch seems to work fine with R-3.0.2 too. On Wed, Mar 5, 2014 at 5:16 PM, Karl Forner wrote: > Hello, > > I submit a patch for review that implements code coverage tracing in > the R interpreter.

[Rd] [PATCH] Code coverage support proof of concept

2014-03-05 Thread Karl Forner
] 331 [2,] 801 $`.../testthat/R/colour-text.r` [,1] [,2] [1,] 181 [2,] 19 106 [3,] 20 106 [4,] 22 106 [5,] 23 106 [6,] 401 [7,] 591 [8,] 701 [9,] 71 106 ... Karl Forner Disclaimer - There are probably bugs and ugly stat

Re: [Rd] How to catch warnings sent by arguments of s4 methods ?

2013-12-02 Thread Karl Forner
to use the calling handlers. Best, Karl On Fri, Nov 29, 2013 at 11:30 AM, Karl Forner wrote: > Hello, > > I apologized if this had already been addressed, and I also submitted > this problem on SO: > http://stackoverflow.com/questions/20268021/how-to-catch-warnings-sent-d

[Rd] How to catch warnings sent by arguments of s4 methods ?

2013-11-29 Thread Karl Forner
tion of the arguments of S4 methods can not get caught using withCallingHandlers(). Is this expected ? Is there a work-around ? Best, Karl Forner __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] problem using rJava with parallel::mclapply

2013-11-11 Thread Karl Forner
d=237) > "-Xrs") > > > ~Malcolm > > > > >-Original Message- > >From: r-devel-boun...@r-project.org [mailto: > r-devel-boun...@r-project.org] On Behalf Of Karl Forner > >Sent: Monday, November 11, 2013 11:41 AM > >To: r-devel

[Rd] problem using rJava with parallel::mclapply

2013-11-11 Thread Karl Forner
Dear all, I got an issue trying to parse excel files in parallel using XLConnect, the process hangs forever. Martin Studer, the maintainer of XLConnect kindly investigated the issue, identified rJava as a possible cause of the problem: This does not work (hangs): library(parallel) require(rJava)

[Rd] unloadNamespace, getPackageName and "Created a package name xxx " warning

2013-10-29 Thread Karl Forner
onder if in the case of import namespaces, getPackageName() could not find a more appropriate name: >parent.env(getNamespace('data.table')) attr(,"name") [1] "imports:data.table" This namespace has a name that might be used to generate the package name. My question

[Rd] Possible problem with namespaceImportFrom() and methods for generic primitive functions

2013-10-18 Thread Karl Forner
know if the problem is on my side, e.g. from a misconfiguration of the NAMESPACE file, or if it is a bug and in which case what should be done. Any feedback appreciated. Karl Forner [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] sys.source() does not provide the parsing info to eval()

2013-06-24 Thread Karl Forner
asses 'srcfilecopy', 'srcfile' # NULL print( str(ex[[1]])) # language 1 + 1 # NULL print( str(ex[1])) # length 1 expression(1 + 1) # - attr(*, "srcref")=List of 1 # ..$ :Class 'srcref' atomic [1:8] 1 1 1 3 1 3 1 1 # .. .. ..- attr(*, &quo

[Rd] bug in package.skeleton(), and doc typo.

2013-06-04 Thread Karl Forner
also a typo in the doc: The sentence: > Otherwise list defaults to the non-hidden **files** in environment (those whose name does not start with .) should be > Otherwise list defaults to the non-hidden **objects** in environment (those whose name does not start with .) Best, Karl Forner &g

Re: [Rd] Catch SIGINT from user in backend C++ code

2013-05-06 Thread Karl Forner
o the original announcement: http://tolstoy.newcastle.edu.au/R/e17/devel/12/02/0443.html Hope it helps. Karl Forner Quartz Bio On Thu, May 2, 2013 at 1:50 AM, Jewell, Chris wrote: > Hi, > > I was wondering if anybody knew how to trap SIGINTs (ie Ctrl-C) in backend > C++ code for R

Re: [Rd] parallel::mclapply does not return try-error objects with mc.preschedule=TRUE

2013-04-23 Thread Karl Forner
> >> Is this a bug ? >> > > Not in parallel. Something else has changed, and I am about to commit a > different version that still works as documented. > > Thanks for replying. [[alternative HTML version deleted]] __ R-devel@r-project.org maili

[Rd] parallel::mclapply does not return try-error objects with mc.preschedule=TRUE

2013-04-11 Thread Karl Forner
Hello, Consider this: 1) library(parallel) res <- mclapply(1:2, stop) #Warning message: #In mclapply(1:2, stop) : # all scheduled cores encountered errors in user code is(res[[1]], 'try-error') #[1] FALSE 2) library(parallel) res <- mclapply(1:2, stop, mc.preschedule=FALSE) #Warning message: #

[Rd] How to avoid using gridextra via Depends instead of Imports in a package ?

2013-03-20 Thread Karl Forner
with the search path, which is a best practice if I'm not mistaken, so we tried hard to solve it using Imports. But I came to realize that the problem was in the grid namespace, not in our package namespace. I tested it with the following work-around: parent.env(parent.env(ge

[Rd] Problem using raw vectors with inline cfunction

2013-02-01 Thread Karl Forner
Hello, >From what I understood from the documentation I found, when using the inline cfunction with convention=".C", R raw vectors should be given as unsigned char* to the C function. But consider the following script: library(inline) testRaw <- cfunction(signature(raw='raw', len='integer')

Re: [Rd] weird bug with parallel, RSQlite and tcltk

2013-01-07 Thread Karl Forner
Hello and thank you. Indeed gsubfn is responsible for loading tcltk in my case. On Thu, Jan 3, 2013 at 12:14 PM, Gabor Grothendieck wrote: > options(gsubfn.engine = "R") __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-deve

Re: [Rd] weird bug with parallel, RSQlite and tcltk

2013-01-03 Thread Karl Forner
t 10:58 PM, Simon Urbanek wrote: > > On Dec 31, 2012, at 1:08 PM, Karl Forner wrote: > >> Hello, >> >> I spent a lot of a time on a weird bug, and I just managed to narrow it down. >> > > First, tcltk and multicore don't mix well, see the warning in the &

[Rd] weird bug with parallel, RSQlite and tcltk

2012-12-31 Thread Karl Forner
) : error 'Interrupted system call' in select Then, just remove library(tcltk), or uncomment unloadNamespace("tcltk"), and it works fine again. I guess there's a bug somewhere, but where exactly ? Best, Karl Forner Further info: R version 2.15.1 (2012-06-22) -- "Roaste

Re: [Rd] portable parallel seeds project: request for critiques

2012-03-02 Thread Karl Forner
Thanks for your quick reply. About the rngSetSeed package: is it usable at c/c++ level ? The same can be said about initializations. Initialization is a random > number generator, whose output is used as the initial state of some > other generator. There is no proof that a particular initializati

[Rd] c/c++ Random Number Generators Benchmarks using OpenMP

2012-03-02 Thread Karl Forner
propose an implementation suiting all needs. Thanks, Karl Forner Annex: I ran the benchmarks on a linux Intel(R) Xeon(R) with 2 cpus of 4 cores each ( CPU E5520 @ 2.27GHz). type threads nerrortime time_per_chunk 1 lecuyer 1 1e+07 2.105472e-04 1.538 0.00153

Re: [Rd] portable parallel seeds project: request for critiques

2012-03-02 Thread Karl Forner
> Some of the random number generators allow as a seed a vector, > not only a single number. This can simplify generating the seeds. > There can be one seed for each of the 1000 runs and then, > the rows of the seed matrix can be > > c(seed1, 1), c(seed1, 2), ... > c(seed2, 1), c(seed2, 2), ... >

[Rd] RcppProgress: progress monitoring and interrupting c++ code, request for comments

2012-02-23 Thread Karl Forner
} } } I provided two small R test functions so that you can see how it looks, please see the doc. I would be extremely grateful if you could give me comments, criticisms and other suggestions. I try to release this in order to reuse this functionality in my other packages. Best r

Re: [Rd] OpenMP and random number generation

2012-02-22 Thread Karl Forner
Hello, For your information, I plan to release "soon" a package with a fast and multithreaded aware RNG for C++ code in R packages. It is currently part of one of my (not yet accepted) packages and I want to extract it into its own package. I plan to do some quick benchmarks too. Of course I can

Re: [Rd] .Call in R

2011-11-18 Thread Karl Forner
> Cheers > Joris > > On Fri, Nov 18, 2011 at 4:08 PM, Karl Forner > wrote: > > Hi, > > > > A probably very naive remark, but I believe that the probability of sum( > > runif(1) ) >= 5 is exactly 0.5. So why not just test that, and > > generate th

Re: [Rd] .Call in R

2011-11-18 Thread Karl Forner
Hi, A probably very naive remark, but I believe that the probability of sum( runif(1) ) >= 5 is exactly 0.5. So why not just test that, and generate the uniform values only if needed ? Karl Forner On Thu, Nov 17, 2011 at 6:09 PM, Raymond wrote: > Hi R developers, > >

[Rd] Fwd: Error in svg() : cairo-based devices are not supported on this build

2011-06-06 Thread Karl Forner
Check what configure is saying when you build R and config.log. You may be > simply missing something like pango-dev - Cairo doesn't use pango while R > does - but it is usually optional (it works on my Mac without pango) so > there may be more to it - config.log will tell you. > I managed to comp

[Rd] Error in svg() : cairo-based devices are not supported on this build

2011-05-19 Thread Karl Forner
Hello, Sorry if it is not the right place.. I installed R-2.13.0 on a x86_64 linux server. All went fine, but the svg() function yells: > svg() Error in svg() : cairo-based devices are not supported on this build I have the Cairo, cairoDevice, RSvgDevice packages installed, and running. > Cai

[Rd] Possible bug in cut.dendrogram when there are only 2 leaves in the tree ?

2011-01-28 Thread Karl Forner
(cut(dd, 0.2)) # here 2 clusters in $lower, as expected So the question is: is it expected behavior that the whole tree is not reported in the $lower if it is itself under the threshold ? Thank you, Karl FORNER [[alternative HTML version deleted]]

Re: [Rd] dendrogram plot does not draw long labels ?

2011-01-25 Thread Karl Forner
at 12:17 PM, Tobias Verbeke < tobias.verb...@openanalytics.eu> wrote: > Hi Karl, > > > On 01/25/2011 11:27 AM, Karl Forner wrote: > > It seems that the plot function for dendrograms does not draw labels when >> they are too long. >> >> hc<- hclust(dist

[Rd] dendrogram plot does not draw long labels ?

2011-01-25 Thread Karl Forner
Hello, It seems that the plot function for dendrograms does not draw labels when they are too long. > hc <- hclust(dist(USArrests), "ave") > dend1 <- as.dendrogram(hc) > dend2 <- cut(dend1, h=70) > dd <- dend2$lower[[1]] > plot(dd) # first label is drawn > attr(dd[[1]], "label") <- "a

Re: [Rd] checking user interrupts in C(++) code

2010-09-29 Thread Karl Forner
Hi, Thanks for your reply, There are several ways in which you can make your code respond to interrupts > properly - which one is suitable depends on your application. Probably the > most commonly used for interfacing foreign objects is to create an external > pointer with a finalizer - that mak

[Rd] checking user interrupts in C(++) code

2010-09-28 Thread Karl Forner
Hello, My problem is that I have an extension in C++ that can be quite time-consuming. I'd like to make it interruptible. The problem is that if I use the recommended R_CheckUserInterrupt() method I have no possibility to cleanup (e.g. free the memory). I've seen an old thread about this, but I w

Re: [Rd] Possible bug or annoyance with library.dynam.unload()

2010-09-22 Thread Karl Forner
ot;, "local/foo") : >> shared library 'foo' was not loaded >> >> # but if you use the absolute path it works: >> >library.dynam.unload("foo", >> "/x05/people/m160508/workspace/foo/local/foo") >> >> Karl >> &g

Re: [Rd] Possible bug or annoyance with library.dynam.unload()

2010-09-22 Thread Karl Forner
but it really looks >> like a bug to me. >> Should I file a bug-report instead of posting in this list ? >> > > I'd probably post instructions for a reproducible example first. Pick some > CRAN package, tell us what to do with it to trigger the error, and then we &g

Re: [Rd] Possible bug or annoyance with library.dynam.unload()

2010-09-21 Thread Karl Forner
Hello, I got no reply on this issue. It is not critical and I could think of work-around, but it really looks like a bug to me. Should I file a bug-report instead of posting in this list ? Thanks, Karl On Thu, Sep 16, 2010 at 6:11 PM, Karl Forner wrote: > Hello, > > I have a packa

[Rd] Possible bug or annoyance with library.dynam.unload()

2010-09-16 Thread Karl Forner
Hello, I have a package with a namespace. Because I use Roxygen that overwrites the NAMESPACE file each time it is run, I use a R/zzz.R file with an .onLoad() and .onUnload() functions to take care of loading and unloading my shared library. The problem: if I load my library from a local director

Re: [Rd] Best way to manage configuration for openMP support

2010-09-15 Thread Karl Forner
Thanks a lot, I have implemented the configure stuff and it works perfectly !! Exactly what I was looking for. I just added AC_PREREQ([2.62]) because the AC_OPENMP was only supported from this version, and AC_MSG_WARN([NO OpenMP support detected. You should should use gcc >= 4.2 !!!]) when no ope

[Rd] Fwd: warning or error upon type/storage mode coercion?

2010-09-15 Thread Karl Forner
-- Forwarded message -- From: Karl Forner Date: Wed, Sep 15, 2010 at 10:14 AM Subject: Re: [Rd] warning or error upon type/storage mode coercion? To: Stefan Evert I'm a Perl fan, and I really really miss the "use strict" feature. IMHO it's very error-pro