[Rd] package level connection API

2009-05-19 Thread Romain Francois
http://tolstoy.newcastle.edu.au/R/e2/devel/06/10/0565.html [2] http://wiki.r-project.org/rwiki/doku.php?id=developers:r_connections_api -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr __ R-devel@r-projec

Re: [Rd] proposed changes to RSiteSearch

2009-05-08 Thread Romain Francois
, Belgium ( ( ( ( ( ...... Romain Francois wrote: strapply in package gsubfn brings elegance here: Don't! If you write functions to be used in a package to be included somehow in the base or recommended packages, then, your package should only depends on... base (preferably), or recomm

Re: [Rd] proposed changes to RSiteSearch

2009-05-08 Thread Romain Francois
lippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Belgium ( ( ( ( ( ...... Romain Francois wrote: Jonathan Baron wrote: After reading all this, I favor doing one of two things: 1. Put all the search st

Re: [Rd] proposed changes to RSiteSearch

2009-05-08 Thread Romain Francois
x27;bar', 1000 ) > rx <- "<(.*?)>(.*?)" > system.time( out <- strapply( txt, rx, c , perl = T ) ) user system elapsed 2.923 0.005 3.063 > system.time( out2 <- sapply( paste('\\', 1:3, sep=''), function(x){ + gsub(rx, x, txt, perl=T

Re: [Rd] proposed changes to RSiteSearch

2009-05-08 Thread Romain Francois
inning (separate package) on the theory that it would be easier for me to make changes than if it were part of utils, but I don't know how this works. So, if someone can make a decision about how to proceed, I'll do what I can, as soon as I can. Jon -- Romain Francois Independen

Re: [Rd] proposed changes to RSiteSearch

2009-05-07 Thread Romain Francois
n't want to do it. I guess it would search gmane. MarkMail is also pretty good, as is http://tolstoy.newcastle.edu.au/R/ All these are much better than Namazu for searching the R-help list. Sorry I didn't make it clear: I meant something like the gmaneSearcg() that Roma

Re: [Rd] proposed changes to RSiteSearch

2009-05-07 Thread Romain Francois
ge, together with any attachme...{{dropped:12}} __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] vignettes in a bundle

2009-04-28 Thread Romain Francois
begin{Schunk} \begin{Soutput} \bibliography{/usr/local/lib/R/library/emulator/doc/bayesian.bib} \end{Soutput} \end{Schunk} So, my question is: why does TeX parse the middle line? why isn't this line interpreted as regular Soutput? best wishes and thanks again Robin Romain Francois wrot

Re: [Rd] vignettes in a bundle

2009-04-28 Thread Romain Francois
ave a bundle comprising three packages. Each package has a vignette. Currently each vignette has a separate .bib file. How do I arrange the bundle so that each vignette accesses a single, common, .bib file? thanks Robin -- Romain Francois Independent R Consult

Re: [Rd] speedup for as.matrix.dist

2009-04-24 Thread Romain Francois
t <- old.as.matrix.dist( d ) ) user system elapsed 17.471 2.964 21.304 Romain Romain Francois wrote: Hello, I am trying to patch as.matrix.dist to achieve some speedup. > m <- expand.grid( x = 1:20, y = 1:20, z = 1:20 ) > d <- dist( m ) > system.time( out <- stats

[Rd] Custom browser prompt instead of Browse[1]>

2009-04-23 Thread Romain Francois
eugster/soc09/#p5) On the same note, what about having a function for the prompt, so that (for example) we could show the current working directory, the memory usage, ... Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr Index: src/librar

Re: [Rd] print.closure at the R level

2009-04-20 Thread Romain Francois
eval(call,env); UNPROTECT(1); break; } so that LANGSXP are printed using the PrintLanguage function and CLOSXP are printed using the R function print.function which in turns calls the PrintClosure function (unless it is masked in R) Romain Romain Francois wrote: Yesterday's patch

Re: [Rd] print.closure at the R level

2009-04-19 Thread Romain Francois
Yesterday's patch did not print the attributes. This one seems fine: > f <- function(){} > attr( f, "yada" ) <- function( ) "lobster bisk" > f function(){} attr(,"yada") function( ) "lobster bisk" Romain Romain Francois wrote: Du

Re: [Rd] print.closure at the R level

2009-04-18 Thread Romain Francois
Duncan Murdoch wrote: On 18/04/2009 10:12 AM, Romain Francois wrote: Hello, Could the code that auto prints a function/closure be extracted from print.c so that there would be a print.closure function. I would like to be able to mask a print.closure function so that I have a custom auto

Re: [Rd] print.closure at the R level

2009-04-18 Thread Romain Francois
Duncan Murdoch wrote: On 18/04/2009 10:12 AM, Romain Francois wrote: Hello, Could the code that auto prints a function/closure be extracted from print.c so that there would be a print.closure function. I would like to be able to mask a print.closure function so that I have a custom auto

[Rd] print.closure at the R level

2009-04-18 Thread Romain Francois
the R console. Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] speedup for as.matrix.dist

2009-04-18 Thread Romain Francois
Hello, I am trying to patch as.matrix.dist to achieve some speedup. > m <- expand.grid( x = 1:20, y = 1:20, z = 1:20 ) > d <- dist( m ) > system.time( out <- stats:::as.matrix.dist( d ) ) user system elapsed 15.355 3.110 19.123 > system.time( out <- as.matrix.dist( d ) ) user system ela

Re: [Rd] suggestion for R >= 3.0: computer-readable CHANGELOG

2009-04-17 Thread Romain Francois
then, accepted by the R core team before going any further. All the best, Philippe Grosjean -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] HTML help

2009-04-15 Thread Romain Francois
r, in most browser, with tag , the formula in the tag works well. such as in wikipedia. please check the same formula: http://en.wikipedia.org/wiki/Johansen_test -- with best regards Jack (Zhan, Hua Ping) +1-514-8800518 -- Romain Francois Independent R Consultant +33(0) 6 28 91

[Rd] top level condition handlers

2009-04-14 Thread Romain Francois
env, NULL, TRUE)) expr } but it does not work, probably because the handler stack is reset somewhere. Would it work if I poke into the RTopLevel.handlerstack instead of the R_HandlerStack as .addCondHands is doing ? R_Toplevel.handlerstack = R_HandlerStack; R_Toplevel.restartstac

Re: [Rd] Why does the lexical analyzer drop comments ?

2009-03-31 Thread Romain Francois
ed in that case ), which at the moment is not possible because the parser only locates entire expression (semantic groupings) and not tokens. > f <- function( x = 2) { + y + 2 + } > checkUsage( f ) : no visible binding for global variable ‘y’ Hadley -- Romain Francois Independent R C

Re: [Rd] Why does the lexical analyzer drop comments ?

2009-03-31 Thread Romain Francois
tion yylex() scans the input, breaking it into  * tokens which are then passed to the parser. The lexical  * analyser maintains a symbol table (in a very messy fashion). so my question is could we use this symbol table to keep track of, say, COMMENT tokens. Why would I even care about that

Re: [Rd] [R] "[.data.frame" and lapply

2009-03-28 Thread Romain Francois
Wacek Kusnierczyk wrote: redirected to r-devel, because there are implementational details of [.data.frame discussed here. spoiler: at the bottom there is a fairly interesting performance result. Romain Francois wrote: Hi, This is a bug I think. [.data.frame treats its arguments

Re: [Rd] [R] "[.data.frame" and lapply

2009-03-26 Thread Romain Francois
(all examples are for named arguments) - echo a warning if trying to pass named arguments to a .Primitive - allow for named arguments as you suggest I'm not sure the last two would be possible without some cost in efficiency. Many thanks, baptiste On 26 Mar 2009, at 07:46

Re: [Rd] Why does the lexical analyzer drop comments ?

2009-03-23 Thread Romain Francois
Duncan Murdoch wrote: On 22/03/2009 4:50 PM, Romain Francois wrote: Romain Francois wrote: Peter Dalgaard wrote: Duncan Murdoch wrote: On 3/20/2009 2:56 PM, romain.franc...@dbmail.com wrote: It happens in the token function in gram.c: Â Â Â c = SkipSpace(); Â Â Â if (c == '

Re: [Rd] Why does the lexical analyzer drop comments ?

2009-03-22 Thread Romain Francois
Romain Francois wrote: Peter Dalgaard wrote: Duncan Murdoch wrote: On 3/20/2009 2:56 PM, romain.franc...@dbmail.com wrote: It happens in the token function in gram.c: Â Â Â c = SkipSpace(); Â Â Â if (c == '#') c = SkipComment(); and then SkipComment goes like that: static int S

[Rd] throwing a "condition" when the current working directory changes

2009-03-20 Thread Romain Francois
r events, or is this abusing the concept of conditions and something else should be used ? hooks ? Also, is there a way to "register" a calling handler so that it listens to every top-level command. Something like options( "error") but for handling other kinds of condition

Re: [Rd] Why does the lexical analyzer drop comments ?

2009-03-20 Thread Romain Francois
ze.) The Rd parser is different, because in an Rd file, whitespace is significant, so it gets kept. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Romain Francois Independent

[Rd] Why does the lexical analyzer drop comments ?

2009-03-20 Thread romain . francois
and it seems a waste to drop the comments. An also, when you print a function to the R console, you don't get the comments, and some of them might be useful to the user. Am I mad if I contemplate looking into this ? Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91 30

[Rd] [SoC09-Idea] Integrated debugger

2009-03-10 Thread Romain Francois
modified to support alternative front-ends. If you come from a front-end standpoint, make a few suggestions on how you would present the information. -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr __ R

[Rd] Bug in codetools ?

2009-03-06 Thread Romain Francois
ux-gnu arch i686 os linux-gnu system i686, linux-gnu status Under development (unstable) major 2 minor 9.0 year 2009 month 03 day03 svn rev48044 language R version.string R version 2.9.0 Under development (unstable) (2009-03-03 r48044) -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] persistence of data

2009-03-05 Thread Romain Francois
g if I am missing an "official" way to do this, similar to system.file does for installed packages. I am aware of the inst directory but this does not solve the problem in cases where the library is read only. Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91

Re: [Rd] profiler and loops

2009-03-03 Thread Romain Francois
Please ignore the previous patch which did not take into account the conditional compilation of doprof on windows. This one does, but was not tested on windows. Romain Romain Francois wrote: Hello, Please find attached a patch against svn implementing this proposal. The part I don't

Re: [Rd] profiler and loops

2009-03-03 Thread Romain Francois
100.0 "rnorm" 0.06 1.1 0.06 1.1 $by.total total.time total.pct self.time self.pct "[for]" 5.38 100.0 5.32 98.9 "rnorm" 0.06 1.1 0.06 1.1 $sampling.time [1] 5.38 Romain Romain Francois wrote:

Re: [Rd] execution time of .packages

2009-03-03 Thread Romain Francois
at installation in any recent version of R. Just check their existence. On Tue, 3 Mar 2009, Romain Francois wrote: Prof Brian Ripley wrote: On Tue, 3 Mar 2009, Romain Francois wrote: Prof Brian Ripley wrote: The caching is in the disc system: you need to find and read the package metadata

[Rd] profiler and loops

2009-03-03 Thread Romain Francois
the list of "functions" that appear in the profiler file. Obviously I am taking some shortcuts here, because of the other loops, but I would like to make a formal patch with this. Before I do that, I'd like to know : - is this has a chance of breaking something else (does the

Re: [Rd] execution time of .packages

2009-03-03 Thread Romain Francois
Prof Brian Ripley wrote: On Tue, 3 Mar 2009, Romain Francois wrote: Prof Brian Ripley wrote: The caching is in the disc system: you need to find and read the package metadata for every package. AFAIK it is not easy to flush the disc cache, but quite easy to overwrite it with later reads

Re: [Rd] execution time of .packages

2009-03-03 Thread Romain Francois
ckages: the Perl code reads the indices from every visible package to resolve links, and that can be slow the first time. On Tue, 3 Mar 2009, Romain Francois wrote: Hello, The first time in a session I call .packages( all.available = T ), it takes a long time (I have many packages ins

[Rd] execution time of .packages

2009-03-03 Thread Romain Francois
velopment (unstable) major 2 minor 9.0 year 2009 month 02 day08 svn rev 47879 language R version.string R version 2.9.0 Under development (unstable) (2009-02-08 r47879) -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30

[Rd] sys.source and encoding

2009-02-24 Thread romain . francois
linux-gnu system i686, linux-gnu status Under development (unstable) major 2 minor 9.0 year 2009 month 02 day08 svn rev47879 language R version.string R version 2.9.0 Under development (unstable) (2009-02-08 r47879) R

Re: [Rd] Identifying graphics files produced by R

2009-02-14 Thread Romain Francois
es of code is your answer. Probably also worth looking in the modules/X11/ and unix directories Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr David M Smith wrote: Oftentimes, I see graphs on the web that *look* like they've been pro

Re: [Rd] Why is srcref of length 6 and not 4 ?

2009-02-12 Thread Romain Francois
Duncan Murdoch wrote: On 12/02/2009 7:01 AM, Romain Francois wrote: Hello, Consider this file (/tmp/test.R) : f <- function( x, y = 2 ){ z <- x + y print( z ) } I get this in R 2.7.2 : > p <- parse( "/tmp/test.R" ) > str( attr( p, "srcref" ) )

[Rd] Why is srcref of length 6 and not 4 ?

2009-02-12 Thread Romain Francois
quot;srcfile")=Class 'srcfile' length 4 and this in R-devel : > p <- parse( "/tmp/test.R" ) > str( attr(p, "srcref") ) List of 1 $ :Class 'srcref' atomic [1:6] 1 1 4 1 1 1 .. ..- attr(*, "srcfile")=Class 'sr

Re: [Rd] SWF animation method

2007-08-08 Thread Romain Francois
Hello Mike, You might want to give "mencoder" a try. It usually comes with mplayer. I did play with it a while ago and was fairly happy with the results. Basically, the idea was to create many jpg files somewhere, which is not too hard using the %03d substitution described in ?jpeg. The rest is

[Rd] graphic for the R profiler

2007-06-29 Thread Romain Francois
((resent without the generated links, thanks Dirk)) Hello all, I just wanted to share a small perl script that generates a dot file from the result of the R profiler. The dot file can than be used to create a graphical display of the profiling. You can save this file in the bin directory of your

[Rd] graphic for the R profiler

2007-06-29 Thread Romain Francois
Hello all, I just wanted to share a small perl script that generates a dot file from the result of the R profiler. The dot file can than be used to create a graphical display of the profiling. You can save this file in the bin directory of your R installation and then create a graph, for exam

[Rd] a taste of regex in `[.data.frame`

2007-04-27 Thread Romain Francois
Hello, I am often asked how to filter lines from a data frame, like for example get all the Mazda cars from mtcars, so that usually does the trick: R> mtcars[ grep("Mazda", rownames(mtcars)) , ] but, what about using a formula in `[.data.frame` to make that sort of code meaningful: # rownames

Re: [Rd] Probem with argument "append" in "Rprof"

2007-03-31 Thread Romain Francois
And now I realize I gave the patches in the wrong order, let me try again Cheers, Romain Romain Francois wrote: > [forgot to attach the second patch in the first mail, sorry.] > > Hello, > > Appending information to the profiler's output seems to generate > pr

[Rd] Probem with argument "append" in "Rprof"

2007-03-31 Thread Romain Francois
[forgot to attach the second patch in the first mail, sorry.] Hello, Appending information to the profiler's output seems to generate problems. Here is a small example of code : require(boot) Rprof( memory.profiling = TRUE) Rprof(NULL) for(i in 1:2){ Rprof( memory.profiling = TRUE, append = T

[Rd] Probem with argument "append" in "Rprof"

2007-03-31 Thread Romain Francois
Hello, Appending information to the profiler's output seems to generate problems. Here is a small example of code : require(boot) Rprof( memory.profiling = TRUE) Rprof(NULL) for(i in 1:2){ Rprof( memory.profiling = TRUE, append = TRUE) example(boot) Rprof(NULL) } The problem is that the

Re: [Rd] SVG and tooltips, hyperlinks

2007-03-07 Thread Romain Francois
Wolfgang Huber wrote: > Dear all, > > is there a good way to create SVG plots with R whose elements have > titles (tooltips) or act as hyperlinks? > > I am using the RSvgDevice package, which works great - but it doesn't > seem to support the notion that plot objects have titles or are act as >

Re: [Rd] invert argument in grep

2006-11-12 Thread Romain Francois
Duncan Murdoch wrote: > On 11/10/2006 12:52 PM, Romain Francois wrote: >> Duncan Murdoch wrote: >>> On 11/9/2006 5:14 AM, Romain Francois wrote: >>>> Hello, >>>> >>>> What about an `invert` argument in grep, to return elements that >>&g

Re: [Rd] invert argument in grep

2006-11-10 Thread Romain Francois
Duncan Murdoch wrote: > On 11/9/2006 5:14 AM, Romain Francois wrote: >> Hello, >> >> What about an `invert` argument in grep, to return elements that are >> *not* matching a regular expression : >> >> R> grep("pink", colors(), invert = TRUE, v

[Rd] invert argument in grep

2006-11-09 Thread Romain Francois
Hello, What about an `invert` argument in grep, to return elements that are *not* matching a regular expression : R> grep("pink", colors(), invert = TRUE, value = TRUE) would essentially return the same as : R> colors() [ - grep("pink", colors()) ] I'm attaching the files that I modified (

[Rd] generic sample

2006-11-09 Thread Romain Francois
Hi, When x is a data frame, sample(x) is not really sensible : R> sample(iris) # sends back all the iris data set. What about a generic sample function (from R-devel/src/library/base/R) with a method for class `data.frame` that would sample the row indexes and then do the subset. See the code

Re: [Rd] Idea: Testimonials

2006-10-27 Thread Romain Francois
Gabor Grothendieck wrote: > It occurred to me that we could have an optional file called TESTIMONIALS > that comes with each package which could be a list of short testimonials from > users indicating success with that package and possibly a few details of > the successful application, e.g. it was

[Rd] modifs on ls

2006-09-26 Thread Romain Francois
Hi all, It would be great to be able to use a syntax like : R> ls("grid:::grid\.") instead of : R> ls("package:grid", pattern = "^grid\.") Here is a modified version of `ls` that does the job. [ The only modifs are just after the if(!missing(name)) ] Does that make sense ? Cheers, Romain

Re: [Rd] not a typo in list.Rd

2006-08-18 Thread Romain Francois
e an obstacle for >>Gregor> exact understanding of the documentation, specially >>Gregor> for non-english users. >> >> I knew what 'iff' means many years before I kn

[Rd] contour lines in filled.contour

2006-06-06 Thread Romain Francois
.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant INRIA Futurs

Re: [Rd] Suggesting changes to HELP files?

2006-05-21 Thread Romain Francois
hiques mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +-------+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctoran

Re: [Rd] Suggesting changes to HELP files?

2006-05-21 Thread Romain Francois
/ Emacs. For that, >>> I use Stangle (as Sundar Dorai-Raj taught me). >>> >>> Thanks, >>> Spencer Graves >>> >>> _

[Rd] bash-like history mechanism and prompt settings

2006-04-13 Thread Romain Francois
e.fr/mixmod/index.php +-------+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant INRIA Futurs / EDF | +---+ ___

Re: [Rd] kcachegrind and R

2006-04-12 Thread Romain Francois
Le 11.04.2006 10:01, Romain Francois a écrit : > Hi, > > Is there a way to use kcachegrind on R code ? > I mean the R function written in R (not the C, etc ... functions). Has > someone tried to generate "Callgrind profile format" from ouputs of Rprof ? > > Romain

Re: [Rd] pattern in history

2006-04-11 Thread Romain Francois
pfile("hist") write(rawhist[inds], file2) file.show(file2, title = "R History", delete.file = TRUE) } -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fc

[Rd] pattern in history

2006-04-11 Thread Romain Francois
ete.file = TRUE) } -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+

[Rd] kcachegrind and R

2006-04-11 Thread Romain Francois
mod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant INRIA Fu

Re: [Rd] R does not have friendly GUI (PR#8656)

2006-03-04 Thread Romain Francois
you know it is open source. Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques Discover the R Movies Gallery : http://addictedtor.free.fr/movies +-------+ | Romain FRANCOIS - http://francoisromain.free.fr

Re: [Rd] Links to non-vignette documentation

2006-02-24 Thread Romain Francois
s[a4paper]{article} %\VignetteIndexEntry{Interface '96 paper by Marron et al. (1997)} %\VignettePackage{clps} \usepackage{hyperref} \usepackage{natbib} \usepackage{pdfpages} \title{Interface '96 paper by \cit

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-08 Thread Romain Francois
ng the lines of what I was thinking. > >An unpleasant work around would be to create a translation package >that does something along the lines of Duncan M.'s suggestion, >importing, renaming, exporting. > > What about : bar <- pack::foo

[Rd] javascript device for R

2006-02-04 Thread Romain Francois
x.php +---+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant INRIA Futurs / EDF | +---+ __ R-devel@r-project.org mailing list

[Rd] What about a bib file

2006-01-30 Thread Romain Francois
you think ? Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+ | Romain FRANCOIS - http://francoisromain.free.fr | |

[Rd] generate Rd file from R file

2006-01-24 Thread Romain Francois
d Rd Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +-------+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant

[Rd] hello World problem

2006-01-12 Thread Romain Francois
od 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+ | Romain FRANCOIS - http://f

<    1   2   3