[Rd] pb in regular expression with the character - (PR#9437)

2007-01-04 Thread xiao . gang . fan1
Full_Name: FAN Version: 2.4.0 OS: Windows Submission from: (NULL) (159.50.101.9) These are expected: grep([\-|c], c(a-a,b)) [1] 1 gsub([\-|c], , c(a-a,b)) [1] aa b but these are strange: grep([d|\-|c], c(a-a,b)) integer(0) gsub([d|\-|c], , c(a-a,b)) [1] a-a b Thanks

Re: [Rd] How to execute R scripts simultaneously from multiple threads

2007-01-04 Thread Erik van Zijst
Vladimir Dergachev wrote: On Wednesday 03 January 2007 3:47 am, Erik van Zijst wrote: Appearantly the R C-API does not provide a mechanism for parallel execution.. It is preferred that the solution is not based on multi-processing (like C/S), because that would introduce IPC overhead. One

[Rd] problem with function 'optimise' (PR#9438)

2007-01-04 Thread karsten_krug
Full_Name: Karsten Krug Version: 2.4.0 OS: Open Suse 10.0, Windows XP Submission from: (NULL) (88.134.13.50) I found a problem in the 'optimise' function for one dimensional optimisation. Example 1: Try to find a maximum of the function below with the use of 'optimise' in the interval

Re: [Rd] pb in regular expression with the character - (PR#9437)

2007-01-04 Thread Prof Brian Ripley
Why do you think this is a bug in R? You have not told us what you expected, but the character range |-| contains only | . Not agreeing with your expectations (unstated or otherwise) is not a bug in R. \- is the same as -, and - is special in character classes. (If it is first or last it is

Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-04 Thread Barry Rowlingson
Ross Boylan wrote: On Wed, Jan 03, 2007 at 11:46:16AM -0600, Ricardo Rios wrote: Hi wizards, does somebody know Which programming paradigm is the most used for make R packages ? Thanks in advance. You need to explain what you mean by the question, for example what paradigms you have in

Re: [Rd] problem with function 'optimise' (PR#9438)

2007-01-04 Thread Dimitris Rizopoulos
the issue here is a numerical one; for instance in your first example check: eps - sqrt(.Machine$double.eps) opt1 - optimise(ex1, lower = 0 - eps, upper = 0.5, maximum = TRUE) # or opt1 - optimise(ex1, lower = 0 + eps, upper = 0.5, maximum = TRUE) which gives the correct results. I hope it

Re: [Rd] Am I missing something about debugging?

2007-01-04 Thread Mark.Bravington
It is possible to do some of these things with the 'debug' package-- the article in R-news 2003 #3 shows a few of the tricks. Suppose 'b1' calls 'c1'. If 'c1' exists as permanent function defined outside 'b1' (which I generally prefer, for clarity), then you can call 'mtrace( c1)' and 'c1' will be

Re: [Rd] problem with function 'optimise' (PR#9438)

2007-01-04 Thread Prof Brian Ripley
That's only incidental to the story. The problem is (code in src/appl/fmin.c) that at the first step symmetry (in both examples) gives fu=fx, and the code has if (fx = fu) { if (u x) a = u; else b = u; } if (fu =

Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-04 Thread Ricardo Rios
A programming paradigm is a paradigmatic style of programming (compare with a methodology, which is a paradigmatic style of doing software engineering). I think , the programming paradigm most used for make R packages is the functional programming , but I don't know this statistic. I need this

Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-04 Thread Gabor Grothendieck
Its object oriented in the sense of the Dylan language. It has some functional elements but true functional languages have better support for recursion, tail recursion and absence of side effects whereas side effects are common in R. On 1/4/07, Ricardo Rios [EMAIL PROTECTED] wrote: A

Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-04 Thread Thomas Lumley
On Thu, 4 Jan 2007, Ricardo Rios wrote: engineering). I think , the programming paradigm most used for make R packages is the functional programming , but I don't know this statistic. I need this information in my thesis. Then you may be in trouble. R (and S before it) are not tidily

Re: [Rd] Am I missing something about debugging?

2007-01-04 Thread Ross Boylan
On Thu, 2007-01-04 at 17:06 +1100, [EMAIL PROTECTED] wrote: It is possible to do some of these things with the 'debug' package-- the article in R-news 2003 #3 shows a few of the tricks. Suppose 'b1' calls 'c1'. If 'c1' exists as permanent function defined outside 'b1' (which I generally

Re: [Rd] How to execute R scripts simultaneously from multiple threads

2007-01-04 Thread Jeffrey Horner
Vladimir Dergachev wrote: On Thursday 04 January 2007 4:54 am, Erik van Zijst wrote: Vladimir Dergachev wrote: On Wednesday 03 January 2007 3:47 am, Erik van Zijst wrote: Appearantly the R C-API does not provide a mechanism for parallel execution.. It is preferred that the solution is not

Re: [Rd] How to execute R scripts simultaneously from multiple threads

2007-01-04 Thread Martin Morgan
Vladimir, Jeff, et al., This is more pre-publicity than immediately available solution, but we've been working on the 'RWebServices' project. The R evaluator and user functions get wrapped in Java, and the Java exposed as web service. We use ActiveMQ to broker transactions between the front-end

Re: [Rd] pb in regular expression with the character - (PR#9437)

2007-01-04 Thread Fan
Let me detail a bit my bug report: the two commands (expected vs strange) should return the same result, the objective of the commands is to test the presence of several characters, '-'included. The order in which we specify the different characters must not be an issue, i.e., to test the

[Rd] Parameter changes and segfault when calling C code through .Call

2007-01-04 Thread Michael Braun
I am experiencing some odd behavior with the .Call interface, and I am hoping someone out there can help me with it. Below is a simple example (in that there are R packages that do exactly what I want), but this code illustrates the problem. Thanks in advance for any help you can provide.

Re: [Rd] pb in regular expression with the character - (PR#9437)

2007-01-04 Thread maechler
FanX == Xiao Gang Fan [EMAIL PROTECTED] on Thu, 04 Jan 2007 21:52:07 +0100 writes: FanX Let me detail a bit my bug report: the two commands FanX (expected vs strange) should return the same FanX result, the objective of the commands is to test the FanX presence of several

Re: [Rd] Parameter changes and segfault when calling C code through .Call

2007-01-04 Thread Seth Falcon
Michael Braun [EMAIL PROTECTED] writes: Suppose I want to compute the log density of a multivariate normal distribution using C code and the gsl library. My R program is: dyn.load(mvnorm-logpdf.so) x-c(0,0,0,0,0,0) mu-c(0,0,0,0,0,0) sig-diag(6) print(sig)

Re: [Rd] pb in regular expression with the character - (PR#9437)

2007-01-04 Thread ripley
Both Solaris 8 grep and GNU grep 2.5.1 give gannet% cat foo.txt a-a b gannet% egrep '[d|-|c]' foo.txt gannet% egrep '[-|c]' foo.txt a-a agreeing exactly with R (and the POSIX standard) and contradicting 'Fan'. On Thu, 4 Jan 2007, Fan wrote: Let me detail a bit my bug report: the two

Re: [Rd] Am I missing something about debugging?

2007-01-04 Thread Mark.Bravington
Hi Ross Suppose 'b1' calls 'c1'. If 'c1' exists as permanent function defined outside 'b1' (which I generally prefer, for clarity), then you can call 'mtrace( c1)' and 'c1' will be invoked whenever it's called-- you don't have to first 'mtrace' 'b1' and then manually call