[Rd] how to call a function from C

2010-01-14 Thread Romain Francois
, but I was wondering if there was another way. I've seen applyClosure, but I'm not sure I should attempt to use it or if using a call like above is good enough. Romain PS: using Rcpp's C++ classes you would express the code above as : Environment stats("package:stats") ;

Re: [Rd] how to call a function from C

2010-01-14 Thread Romain Francois
uation (and translate it as an exception). Sure. I did not want to over-complicate the question. I'm currently reviewing tryEval and its underlying R_TopLevelExec which does not give me enough : when the error occurs, it'd be useful that the function returns the condition obj

Re: [Rd] how to call a function from C

2010-01-14 Thread Romain Francois
you be more specific ? The whole purpose of the package is to hide the R API. The user does not need to know the R API to use the classes of Rcpp. We however indeed use and abuse the R API a lot internally. Romain If I am mistaken and there are any users of RcppTemplate please let me know, a

Re: [Rd] how to call a function from C

2010-01-14 Thread Romain Francois
On 01/14/2010 02:27 PM, Laurent Gautier wrote: On 1/14/10 1:16 PM, Romain Francois wrote: On 01/14/2010 12:42 PM, Laurent Gautier wrote: Hi, In Rcpp, we now have a "Function" class to encapsulate functions (they cover all three kinds, but this may change). Just a note on that

[Rd] compiler specific flags : -std=c++0x

2010-01-18 Thread Romain Francois
do test that the compiler is indeed GCC >= 4.3 as part of our configure script and we only add the flag in that case. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7.2 |- http://tr.im/JOlc : Extern

Re: [Rd] R CMD check error with the GNU Scientific Library

2010-01-22 Thread Romain Francois
Hi, You'll need something like : PKG_LIBS=-lgsl -lgslcblas in your Makevars. This is from package gsl (on CRAN). Or maybe you can just depend on the gsl package and let it worry about finding where gsl is, etc ... Romain On 01/22/2010 10:59 AM, pleyd...@supagro.inra.fr wrote: I

[Rd] LinkingTo and C++

2010-02-11 Thread Romain Francois
ve been looking at http://cran.r-project.org/doc/manuals/R-exts.html#Registering-native-routines but it seems only applicable to c(++) functions and not classes ... What am I missing ? Should/can linkingto be extended in a way that accomodates c++ Romain -- Romain Francois Professio

Re: [Rd] LinkingTo and C++

2010-02-11 Thread Romain Francois
On 02/11/2010 10:08 AM, Romain Francois wrote: Hello, I've been trying to make LinkingTo work when the package linked to has c++ code. I've put dumb packages to illustrate this emails here ; http://addictedtor.free.fr/misc/linkingto Package A defines this C++ class: class A {

Re: [Rd] LinkingTo and C++

2010-02-11 Thread Romain Francois
Thanks. On 02/11/2010 05:55 PM, Simon Urbanek wrote: Romain, I think your'e confusing two entirely different concepts here: Yes. The name "LinkingTo" probably helped my confusion. 1) LinkingTo: allows a package to provide C-level functions to other packages (see R-ext

Re: [Rd] LinkingTo and C++

2010-02-11 Thread Romain Francois
On 02/11/2010 07:40 PM, Simon Urbanek wrote: On Feb 11, 2010, at 12:24 PM, Romain Francois wrote: Thanks. On 02/11/2010 05:55 PM, Simon Urbanek wrote: Romain, I think your'e confusing two entirely different concepts here: Yes. The name "LinkingTo" probably help

Re: [Rd] Portability of a C function

2010-02-14 Thread Romain Francois
Hello, This was discussed this week in the thread "LinkingTo and C++". It is possible, and documented in WRE section 5.4 : http://cran.r-project.org/doc/manuals/R-exts.html#Registering-native-routines Romain On 02/14/2010 12:58 PM, Christophe Genolini wrote: Hi the list, In a

Re: [Rd] How S3method() is implemented and called? And when to use it?

2010-02-14 Thread Romain Francois
Hello `Blue Sky` , Will you please start posting under your real name. As documented in WRE, S3method is meant for use in namespaces: http://cran.r-project.org/doc/manuals/R-exts.html#Registering-S3-methods It is not an R function. Romain On 02/14/2010 07:32 PM, blue sky wrote: R-exts.pdf

Re: [Rd] how to create a SEXP which could be accessed in embedded R

2010-02-20 Thread Romain Francois
: SEXP x = PROTECT( allocVector( STRSXP, 2 ) ); SET_STRING_ELT( x, 0, Rf_mkChar( "foo" ) ) ; SET_STRING_ELT( x, 1, Rf_mkChar( "bar" ) ) ; defineVar( Rf_install("x"), x, R_GlobalEnv ) ; UNPROTECT(1) ; /* x */ Romain PS: with Rcpp, you can do the same as : usin

Re: [Rd] Mentor for GSOC '10: Symbolic Regression in R

2010-03-03 Thread Romain Francois
opposed to manage R API quirks. Also, you can count on some implicit support through Rcpp mailing list. https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Good luck finding a mentor, this sounds like a cool project. Romain On 03/03/2010 08:17 PM, Chidambaram Annamalai wrote

Re: [Rd] for help on building a R package with several R function and a bunch of c, c++

2010-03-07 Thread Romain Francois
ear to you, and b) what made you think you needed to repost _the identical question_ here | Thank you in advance! You're welcome. Dirk -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images

[Rd] duplicate STRSXP : shallow copy ?

2010-03-07 Thread Romain Francois
? If not, I can track it down to the DUPLICATE_ATOMIC_VECTOR in duplicate.c and submit a patch. Also, CHARSXP don't seem to be actually duplicated : case CHARSXP: return s; Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blo

Re: [Rd] duplicate STRSXP : shallow copy ?

2010-03-07 Thread Romain Francois
Hello, I understand now that this is very intended after reading: http://cran.r-project.org/doc/manuals/R-ints.html#The-CHARSXP-cache So we are not supposed to modify a CHARSXP character by character. Sorry for the noise. Romain On 03/07/2010 10:48 AM, Romain Francois wrote: Hello, As

Re: [Rd] for help on building a R package with several R function and a bunch of c, c++

2010-03-07 Thread Romain Francois
urage you to use the dedicated Rcpp-devel mailing list : https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Romain On 03/08/2010 04:20 AM, alex46...@yahoo.com wrote: Thank you for your help. So far what I did on my notebook as follows. My OS is windows7.  I downloaded

Re: [Rd] for help on building a R package with several R function and a bunch of c, c++

2010-03-08 Thread Romain Francois
e.skeleton adds a useDynLib directive to the NAMESPACE so you should be fine. Thank you so much! > Alex --- On Mon, 3/8/10, Romain Francois wrote: From: Romain Francois Subject: Re: [Rd] for help on building a R package with several R function and a bunch of c, c++ To: alex46...@yahoo.

Re: [Rd] Trouble in using rJava

2010-03-30 Thread Romain Francois
2.8.1, 2.9.0, 2.9.1, 2.9.2, 2.10.0. Can you try to use the current version of R and see if this fix your vague problem. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe

[Rd] inject html code into Rd file

2010-04-02 Thread Romain Francois
t hello, i.e. characters < and > are replaced with html entities : < and > Is there a way to turn this off ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/O

Re: [Rd] inject html code into Rd file

2010-04-02 Thread Romain Francois
Le 02/04/10 13:07, Duncan Murdoch a écrit : On 02/04/2010 6:17 AM, Romain Francois wrote: Hello, I'm trying to inject html code into an Rd file. For example : \name{test} \alias{test} \title{test} \description{ \if{html}{ \Sexpr[stage=render,results=text,echo=FALSE]{ "hello" }

Re: [Rd] inject html code into Rd file

2010-04-03 Thread Romain Francois
Le 03/04/10 02:04, Duncan Murdoch a écrit : On 02/04/2010 8:06 AM, Duncan Murdoch wrote: On 02/04/2010 7:13 AM, Romain Francois wrote: Le 02/04/10 13:07, Duncan Murdoch a écrit : On 02/04/2010 6:17 AM, Romain Francois wrote: Hello, I'm trying to inject html code into an Rd file

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Romain Francois
_ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9aKDM9 : embed images in Rd documents |- http://tr.im/OIXN : raster images and RImageJ |

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Romain Francois
Le 21/04/10 21:39, Simon Urbanek a écrit : On Apr 21, 2010, at 3:32 PM, Romain Francois wrote: Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF

Re: [Rd] RUnit bug?

2010-04-22 Thread Romain Francois
(with names that end with '~') then runTestSuite gets confused and tries to run functions from the temp files as well. How do you define 'testsuite.math'. The default value of the testFileRegexp argument in defineTestSuite should rule these files out. Romain -- Romain Fra

Re: [Rd] Resolving functions using R's namespace mechanism can double runtime

2010-04-27 Thread Romain Francois
can understand why use of this mechanism is not free in an interpreted environment like R, but the cost seems rather high. Dominick -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9aKDM9 : embed images in Rd documents |- h

Re: [Rd] RInside & child threads

2010-05-01 Thread Romain Francois
-devel Romain Le 30/04/10 19:32, Jaiganesh Balasubramanian a écrit : Hi Folks, I am creating a multi-threaded C++ application that initializes RInside in one of the child thread. I would also like to access support interfaces like Rcpp::Environment in the remaining child threads, so that I could

Re: [Rd] RInside & child threads

2010-05-01 Thread Romain Francois
-devel Romain Le 30/04/10 19:32, Jaiganesh Balasubramanian a écrit : Hi Folks, I am creating a multi-threaded C++ application that initializes RInside in one of the child thread. I would also like to access support interfaces like Rcpp::Environment in the remaining child threads, so that I could

Re: [Rd] Memory allocation in C/C++ vs R?

2010-05-01 Thread Romain Francois
rror exception, so that it can be handled in terms of c++ try/catch. This is somewhat a hack due to the lack of explicit C level api for R error handling. http://www.mail-archive.com/r-devel@r-project.org/msg19300.html Romain On 1: You cannot interleave R error handling and C++ exceptions.

[Rd] print.data.frame curiosity

2010-05-06 Thread Romain Francois
olumn named "stringsAsFactors". (I know this is a bad name for a column, but ...) Apparently, this line in format.data.frame is responsible for the mismatch: x <- do.call("data.frame", rval) Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 h

Re: [Rd] Use of R and Rscript in configure/Makevars in packages

2010-05-20 Thread Romain Francois
Hello, Thank you for these clear guidelines. Given these subtleties, would it make sense to have a "configure.R" that would win over configure and configure.win, and have R invoking it correctly, as below ? Romain Le 20/05/10 08:51, Prof Brian Ripley a écrit : We have seen pro

Re: [Rd] Use of R and Rscript in configure/Makevars in packages

2010-05-20 Thread Romain Francois
Le 20/05/10 09:40, Prof Brian Ripley a écrit : On Thu, 20 May 2010, Romain Francois wrote: Hello, Thank you for these clear guidelines. Given these subtleties, would it make sense to have a "configure.R" that would win over configure and configure.win, and have R invoking it cor

Re: [Rd] R 2.10 and help

2010-05-27 Thread Romain Francois
int( url ) ) > ?plot [1] "http://127.0.0.1:9000/library/graphics/html/plot.html"; Romain Ta It's much more simple since 2.10 as you can simply use the URL (same URL as the help system uses). For examples see JGR or the Mac GUI. Or you can do the same thing that the Rhttpd

[Rd] require( "foo (>= 2.1)" )

2010-05-28 Thread Romain Francois
does not work for loose dependencies, when package "bar" works better with "foo" but can still work fine without, or when not making a package. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http

[Rd] S4 dispatch for .DollarNames (utils)

2010-05-29 Thread Romain Francois
plicitely : > require( foo ) > x <- new( "trackCurve", x = 1:10, y = 1:10, smooth = 1:10 ) > .DollarNames( x, "f" ) [1] "foo" but completion does not work : > x$f x$ What do I miss ? I've uploaded foo here : http://addictedtor.free.fr/misc/rcp

Re: [Rd] S4 dispatch for .DollarNames (utils)

2010-05-29 Thread Romain Francois
lockBinding( ".DollarNames", utils ) } Any better idea ? Romain Le 29/05/10 13:21, Romain Francois a écrit : Hello, I'm trying to make .DollarNames generic and implement a method for it in a package. .DollarNames is the function that is now called to get completion pos

Re: [Rd] S4 dispatch for .DollarNames (utils)

2010-05-29 Thread Romain Francois
Le 29/05/10 20:23, Deepayan Sarkar a écrit : On Sat, May 29, 2010 at 4:21 AM, Romain Francois wrote: Hello, I'm trying to make .DollarNames generic and implement a method for it in a package. .DollarNames is the function that is now called to get completion possibilities. My R code

Re: [Rd] S4 dispatch for .DollarNames (utils)

2010-05-29 Thread Romain Francois
Thanks. I'll apply the nice workaround for now. Romain Le 29/05/10 23:15, John Chambers a écrit : The idea of modifying .DollarNames to recognize S4 methods is OK, but the problem could arise again. It would be better to have a general solution. The general problem as it seems is that

Re: [Rd] require( "foo (>= 2.1)" )

2010-05-30 Thread Romain Francois
nt are not accepted. I'm not complaining about it, it is always an opportunity to learn something ... Romain Le 30/05/10 14:49, Wolfgang Huber a écrit : Hi Romain, not that I have any authority here, but wouldn't your suggestion (which I think could be very useful) be more

Re: [Rd] require( "foo (>= 2.1)" )

2010-05-31 Thread Romain Francois
Le 31/05/10 10:41, Barry Rowlingson a écrit : On Sun, May 30, 2010 at 5:50 PM, Romain Francois wrote: Hi, Sure. I could and I would provide a patch. Since this is more of a "nice to have", I wanted to first find out whether others would find it useful, and also if such a patch

[Rd] using C++ finalizers for external pointers

2010-06-16 Thread Romain Francois
finalizer (with R_RegisterFinalizer) using another external pointer to some class be appropriate ? Romain [1] : http://article.gmane.org/gmane.comp.lang.r.rcpp/433 -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u :

Re: [Rd] SVG and tooltips, hyperlinks

2007-03-07 Thread Romain Francois
Plate posted an altered version of RSvgDevice on the finance list a couple of weeks ago. https://stat.ethz.ch/pipermail/r-sig-finance/2007q1/001261.html It does not do hyperlinks yet, but that should not be too difficult to do. Cheers, Romain -- Mango Solutions data analysis that delivers Te

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

2007-03-31 Thread Romain Francois
. I also attach a patch against R-devel/src/scripts/Rprof that would at least get rid of the memory profiling information (if any). This is not as good as dealing with it, but ... this is the first time I ever touch a Perl script. Cheers, Romain > version

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

2007-03-31 Thread Romain Francois
ess it could be a useful way to do it. I also attach a patch against R-devel/src/scripts/Rprof that would at least get rid of the memory profiling information (if any). This is not as good as dealing with it, but ... this is the first time I ever touch a Perl script. Cheers, Romain > version _

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] a taste of regex in `[.data.frame`

2007-04-27 Thread Romain Francois
length(j)]], names(x) ) if(!missing(i) && inherits(i, "formula")) i <- grep( i[[length(i)]], if(Narg>=3) rownames(x) else names(x)) I realize that there are also other places where this could be used, an obvious one being `[<-.data.frame`, but i wanted t

[Rd] graphic for the R profiler

2007-06-29 Thread Romain Francois
example an SVG by piping the output of the script to dot: $ R CMD Rprof2dot Rprof.out | dot -Tsvg > test3.svg Some example graphics are presented in the R wiki here: http://wiki.r-project.org/rwiki/doku.php?id=tips:misc:profiling Cheers, Romain #! /usr/bin/perl use Getopt::Long; my $cut

[Rd] graphic for the R profiler

2007-06-29 Thread Romain Francois
your R installation and then create a graph, for example an SVG by piping the output of the script to dot: $ R CMD Rprof2dot Rprof.out | dot -Tsvg > test3.svg Some example graphics are presented in the R wiki here: http://wiki.r-project.org/rwiki/doku.php?id=tips:misc:profiling Cheers, Rom

Re: [Rd] SWF animation method

2007-08-08 Thread Romain Francois
he rest is described here: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-enc-images.html Cheers, Romain PS: You might find some links in this (not really maintained) webpage: http://addictedtor.free.fr/movies/ Mike Lawrence wrote: > Hi all, > > Just thought I'd share something

[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] 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" ) )

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

[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

[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

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

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

[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
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

Re: [Rd] profiler and loops

2009-03-03 Thread Romain Francois
ot; because I don't really know how to extract the information. With the script1 from my previous post, summaryRprof produces this: []$ /home/romain/workspace/R-trunk/bin/Rscript script1.R $by.self self.time self.pct total.time total.pct "[for]" 5.32 98.9 5.38

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

[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

[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] [SoC09-Idea] Integrated debugger

2009-03-10 Thread Romain Francois
Hello, Hello, Here is an idea for a google summer of code project I am willing to mentor. Romain Summary: Create an integrated debugger. Required skills: R skills. Experience of using a debugger. Front-end skills depending on the chosen front-end(s). Description: Debugging R code usually

[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

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] 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-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

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] [R] "[.data.frame" and lapply

2009-03-26 Thread Romain Francois
ready works, what does not work is how `[.data.frame` treats them, and that needs to be changed, this is a bug. Romain > version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status Under development (uns

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] Why does the lexical analyzer drop comments ?

2009-03-31 Thread Romain Francois
vidence is collected, other functions (renderers) will have the task to render the evidence using html, latex, rtf, ansi escape codes, ... the idea here is to design the system so that other packages can implement custom renderers to format the evidence in their markup language Romain Yihui Xie

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

[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] HTML help

2009-04-15 Thread Romain Francois
/mathml/asciimath.html for example. Romain mnorton52 wrote: Hi Jack, I'm not sure about the tag either, and it didn't work when I tried it. I think the approach this web page uses may help in writing mathematical symbols to HTML: http://comers.citadel.edu/math_sym2005.htm Cheers, M

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

2009-04-17 Thread Romain Francois
in its own file, and cranberry that. Is CRANberry an R package ? Romain The basic function to retrieve data that would answer to these questions would be something like: > changes(c("foo", "bar")) That function could, for instance, read information in a compu

[Rd] speedup for as.matrix.dist

2009-04-18 Thread Romain Francois
st( d ) ) user system elapsed 3.153 0.480 3.782 The code below works if I deploy it in an additional package, but not when I patch the "stats" package, I get that kind of message: C symbol name "as_matrix_dist" not in load table Romain as.matrix.dist <- functio

[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

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

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-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

[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] 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

Re: [Rd] vignettes in a bundle

2009-04-28 Thread Romain Francois
Hi Robin, Something like: <>= bib <- system.file( "bib", "mybib.bib", package = "yada" ) cat( "\\bibliography{",bib,"}\n") @ It would also be nice to be able to use bibliography in Rd files ... Romain Robin Hankin wrote: Hi I h

Re: [Rd] vignettes in a bundle

2009-04-28 Thread Romain Francois
Would this work better: <>= bib <- system.file( "doc", "bayesian.bib", package = "emulator" ) cat( "\\bibliography{",bib,"}\n",sep='') @ Romain Robin Hankin wrote: Hello Romain this is brilliant; it never occurred

Re: [Rd] Links to non-vignette documentation

2006-02-24 Thread Romain Francois
; > \bibliographystyle{dcunsp} > \bibliography{clps} > > \end{document} > Hi, What about using the latex package pdfpages to copy the pages from your PDF file `interface96.pdf` to your Sweave file. (I don't know if it is compatible with Sweave). Not tested : \documentclas

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

2006-03-04 Thread Romain Francois
What you described is *so* not a bug. You have not tried hard enough. There are gui for R : JGR, sciviews, Rcmdr, etc You can export results in HTML (package R2HTML), to latex (package xtable). If the features therein are not completely satisfying your needs, you can contribute something, as

[Rd] kcachegrind and R

2006-04-11 Thread Romain Francois
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 -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mix

[Rd] pattern in history

2006-04-11 Thread Romain Francois
Hi, Sometimes I need to consult the history of commands that are matching a regex, so I modified the utils::history function for that purpose. I found it useful. I append the code ( I only added the two lines with #**) Romain. history2 <- function (pattern="", max.show = 25, re

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

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

[Rd] bash-like history mechanism and prompt settings

2006-04-13 Thread Romain Francois
(for example) the current time, and the number of the command to come [445-10:58:54] R> (I'm using R from gnome-terminal on fedora 5) Regards, Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fcomt

Re: [Rd] Suggesting changes to HELP files?

2006-05-21 Thread Romain Francois
search *only* on the help pages. You are not missing anything, you just came too early. Of course, you can already add material into the wiki, but the user level is not really ready I think. Also, there is a special interest list about the wiki where you can find more answers to your que

Re: [Rd] Suggesting changes to HELP files?

2006-05-21 Thread Romain Francois
e that discussion to : https://stat.ethz.ch/mailman/listinfo/r-sig-wiki Philippe Grosjean is currently working on Rdconv script to convert Rd files into wiki, see : https://stat.ethz.ch/pipermail/r-sig-wiki/2006-May/000261.html Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/grap

[Rd] contour lines in filled.contour

2006-06-06 Thread Romain Francois
filled.contour such that the lines are drawn internally when computed in do_filledcontour. The code is in src/main/plot3d.c in the current R-devel. I would like to do it, but I don't understand the internals. Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1

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] 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)) ] Doe

Re: [Rd] Idea: Testimonials

2006-10-27 Thread Romain Francois
The author and maintainer could list their own applications in > that file too if they wished. > > Another possibility is to place the testimonials in the vignette if there > is one. > Hi, Could that kind of things go to the wiki http://wiki.r-project.org/rwiki/doku.php?id=pa

[Rd] generic sample

2006-11-09 Thread Romain Francois
ode below. Cheers, Romain sample <- function(x, ...) UseMethod("sample") sample.data.frame <- function(x, ...){ x[ sample(1:nrow(x), ...), ] } sample.default <- function(x, size, replace=FALSE, prob=NULL) { if(length(x) == 1 && x >= 1)

<    1   2   3   4   >