Re: [Rd] help with rchk warnings on Rf_eval(Rf_lang2(...))

2020-03-24 Thread Romain Francois
> Le 23 mars 2020 à 22:55, Dirk Eddelbuettel a écrit : > > On 23 March 2020 at 17:07, Ben Bolker wrote: > | Or is there a way I can use Shield() since this an Rcpp-based project > | anyway? > > Yes you can, and I would recommend it. > > Example from Rcpp itself, file Environment.h: > > Shie

Re: [Rd] What is the best way to loop over an ALTREP vector?

2019-09-24 Thread Romain Francois
Thanks for these comments. I should alter the blog post or write some follow up. This was a weekend blog post that only benefited from a short time of research research. I’m glad people find it useful, but I’m sure a detailed documentation of the features from the authors would be more useful.

Re: [Rd] Use of C++ in Packages

2019-03-30 Thread Romain Francois
tl;dr: we need better C++ tools and documentation. We collectively know more now with the rise of tools like rchk and improved documentation such as Tomas’s post. That’s a start, but it appears that there still is a lot of knowledge that would deserve to be promoted to actual documentation of

Re: [Rd] R_ext/Altrep.h should be more C++-friendly

2018-10-10 Thread Romain Francois
Thank you, I updated my example package so that it works with both. https://github.com/romainfrancois/altrepisode/blob/96af0548a9ecc08701d119ea427e16940a82882b/src/altrepisode.h We

Re: [Rd] R_ext/Altrep.h should be more C++-friendly

2018-10-09 Thread Romain Francois
I successfully use this workaround in this package: https://github.com/romainfrancois/altrepisode (which is just my way to get familiar with altrep, nothing serious) > Le 9 oct. 2018 à 17:00, Gabe Becker a écrit : > > Michael, > > Thanks for reaching out. This was brought up by Romaine Franco

Re: [Rd] Linking to the BH package introduces CRAN warnings

2014-11-05 Thread Romain Francois
Envoyé de mon iPhone > Le 5 nov. 2014 à 13:43, Dirk Eddelbuettel a écrit : > > > On 5 November 2014 at 00:55, kaveh wrote: > | Dear all, > | > | > | the simple code in below, when send to the > | win-builder returns the following (and no other) > | warning: > | > | > | * checking compiled

Re: [Rd] Looking for new maintainer of orphans R2HTML SemiPar cghseg hexbin lgtdl monreg muhaz operators pamr

2014-09-07 Thread Romain Francois
I'll pick up operators. Le 7 sept. 2014 à 18:03, Uwe Ligges a écrit : > > > On 05.09.2014 20:25, Greg Snow wrote: >> Uwe, >> >> Have all of these packages found new maintainers? if not, which ones >> are still looking to be adopted? > > Thanks for asking, the ones still looking to be adaopt

Re: [Rd] using C code to create data frame but always return as list

2014-06-24 Thread Romain Francois
Hi, Can you give us what str on the returned object gives you? I think you need : SET_OBJECT(and, 1) ; at the end. Romain Le 24 juin 2014 à 08:57, Yu Gong a écrit : > there is my code, expect return value is a data frame but R say it is list: > > SEXP Julia_R_MD_NA_DataFrame(jl_valu

Re: [Rd] Is it possible to shrink an R object in place?

2014-04-11 Thread Romain Francois
Hello, I’ve been using shrinking in https://github.com/hadley/dplyr/blob/master/inst/include/tools/ShrinkableVector.h This defines a ShrinkableVector of some R type (INTSXP, ...) given the maximum number of elements it will hold. Then, I reset with SETLENGTH when needed. The constructor prote

Re: [Rd] CXX_STD and configure.ac in packages

2014-03-30 Thread Romain Francois
Hi, My advice would be to use SystemRequirements: C++11 As is definitely a part of C++11, assuming this version of the standard gives it to you. Your package may not compile on platforms where a C++11 compiler is not available, but perhaps if this becomes a pattern, then such compilers will

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

2014-03-19 Thread Romain Francois
Weighting in. FWIW, I find the proposal conceptually quite interesting. For package developers, it does not have to be a frustration to have to wait a new version of R to release their code. Anticipated frustration was my initial reaction. Thinking about this more, I think this could be changed

Re: [Rd] getting environment from "top" promise

2014-02-14 Thread Romain Francois
Le 14 févr. 2014 à 16:40, luke-tier...@uiowa.edu a écrit : > On Tue, 11 Feb 2014, Romain Francois wrote: > >> Hello, >> >> We have something very similar to your while loop in dplyr. >> https://github.com/hadley/dplyr/blob/02a609310184d003c2ae9e0c013bfa69fa4d257a

Re: [Rd] getting environment from "top" promise

2014-02-11 Thread Romain Francois
Hello, We have something very similar to your while loop in dplyr. https://github.com/hadley/dplyr/blob/02a609310184d003c2ae9e0c013bfa69fa4d257a/inst/include/tools/DataDots.h#L15 because we need to know exactly in which environment a promise is supposed to be evaluated, even though we might co

[Rd] LinkingTo self

2014-02-03 Thread Romain Francois
Hello, Shipping header files for a package in inst/include and let other packages use it with LinkingTo is popular. Unfortunately for the package itself, we still need to use something like : PKG_CPPFLAGS+=-I../inst/include/ in the Makevars and Makevars.win files. Could this become automat

Re: [Rd] Strategies for keeping autogenerated .Rd files out of a Git tree

2013-12-13 Thread Romain Francois
Pushing back to github is not so difficult. See e.g http://blog.r-enthusiasts.com/2013/12/04/automated-blogging.html You can manage branches easily in travis. You could for example decide to do something different if you are on the master branch ... Romain Le 13 déc. 2013 à 12:03, Kirill Mü

Re: [Rd] Linking to native routines in other packages

2013-12-06 Thread Romain Francois
ve to ask every package maintainer to negociate that when they release a package that depends on Rcpp. Perhaps that's alright. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 __ R-devel@r-project.org mailing list https://

Re: [Rd] serialization for external pointers

2013-11-16 Thread Romain Francois
Le 16/11/2013 14:30, Romain Francois a écrit : Hello, Are there any recipe to handle serialization / deserialization of external pointers. I'm thinking about something similar in spirit to the way we handle finalization of external pointers. Currently, if we create an external pointer,

[Rd] serialization for external pointers

2013-11-16 Thread Romain Francois
sActive("fred", .GlobalEnv) [1] TRUE > > q("yes") get get romain@naxos /tmp $ R [..] > fred [1] 1 > bindingIsActive("fred", .GlobalEnv) [1] FALSE Is this possible ? Is there any other hook to handle seriali

Re: [Rd] Linking to native routines in other packages

2013-11-16 Thread Romain Francois
Le 16/11/2013 11:02, Romain Francois a écrit : Hello, I'm currently working on making Rcpp use the feature described here more: http://cran.r-project.org/doc/manuals/R-exts.html#Linking-to-native-routines-in-other-packages To give more context, Rcpp has for a long time built what we c

[Rd] Linking to native routines in other packages

2013-11-16 Thread Romain Francois
p from another package, we are retrieving the function https://github.com/RcppCore/Rcpp/blob/master/src/Rcpp_init.cpp where the functions are registered with the RCPP_REGISTER macro. This way of using it moves all the logic to the package exposing its functions. I find this nicer to us

Re: [Rd] Dynamic list creation (SEXP in C) returns error "unimplemented type (29) in 'duplicate'"

2013-11-07 Thread Romain Francois
Le 07/11/2013 14:43, Romain Francois a écrit : Le 07/11/2013 14:30, George Vega Yon a écrit : Romain, Thanks for your quick response. I've already received that suggestion, but, besides of haven't ever used C++, I wanted to understand first what am I doing wrong. For that type of c

Re: [Rd] Dynamic list creation (SEXP in C) returns error "unimplemented type (29) in 'duplicate'"

2013-11-07 Thread Romain Francois
e loop which will lead to disastrous performance. Romain Thanks again! George Vega Yon +56 9 7 647 2552 http://ggvega.cl 2013/11/7 Romain Francois : Hello, Any particular reason you're not using Rcpp? You would have access to nice abstraction instead of these MACROS all over th

Re: [Rd] Dynamic list creation (SEXP in C) returns error "unimplemented type (29) in 'duplicate'"

2013-11-07 Thread Romain Francois
-- Gabriel Becker Graduate Student Statistics Department University of California, Davis -- Gabriel Becker Graduate Student Statistics Department University of California, Davis __ 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 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R 3.1.0 and C++11

2013-11-04 Thread Romain Francois
Romain, will you be taking pull requests? Yes. Definitely. I will carefully review them. Can give you write access too. I'm getting a good feel of what C++11 brings while developping Rcpp11. But I think it makes a lot of sense to write such an article with other people as well. R

Re: [Rd] C++ debugging help needed

2013-10-02 Thread Romain Francois
lder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/unnamed_namespaces.htm - If I really do have calls to the wrong destructor in there, how do I avoid this? Are you invoking the destructor explicitly? An object should know it's type, whi

Re: [Rd] C++ debugging help needed

2013-10-02 Thread Romain Francois
it otherwise uses an igraph namespace: /** Shape.h */ #ifndef SHAPE_H #define SHAPE_H #include #include "Color.h" #include "Ray.h" #include "Point.h" class Shape [] So the clash is due to two packages simulatenously failing

Re: [Rd] C++ debugging help needed

2013-10-02 Thread Romain Francois
- If I really do have calls to the wrong destructor in there, how do I avoid this? Duncan Murdoch -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Using long long types in C++

2013-09-19 Thread Romain Francois
Karl, Brian gave some insights already. I'm also reluctant to use int64_t because there does not seem to be a standard version of what the type is. Eg on OSX, int64_t is a typedef to long long. IIRC there are cases where it is a typedef to long ... At least with long an long long they are g

Re: [Rd] Using long long types in C++

2013-09-19 Thread Romain Francois
Le 20 sept. 2013 à 02:31, Patrick Welche a écrit : > On Fri, Sep 20, 2013 at 12:51:52AM +0200, rom...@r-enthusiasts.com wrote: >> In Rcpp we'd like to do something useful for types such as long long >> and unsigned long long. > ... >> But apparently this is still not enough and on some versions o

Re: [Rd] Calling an array in a struct in C to R

2013-06-20 Thread Romain Francois
do I get the information in the float array 'a.array' in R? Is it even possible or should I rewrite my C code using Call in R? Another, not preferred, options is to pre-allocate the array/vector in R on a fixed (large-enough) size? Or do I miss something here? Regards. -- Romain Francois P

Re: [Rd] invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.

2013-05-14 Thread Romain Francois
Please use the appropriate mailing list (Rcpp-devel) for Rcpp questions. Romain Le 14 mai 2013 à 06:42, Xiao He a écrit : > Dear R-Developers, > > I just started learning how to use Rcpp. Earlier while using it, I > encountered an error as shown below: > > file74d8254b96d4.cpp: In function ‘

Re: [Rd] Problem using raw vectors with inline cfunction

2013-02-01 Thread Romain Francois
r(raw)," printed in the traceback is responsible for the observed behavior. If it is expected behavior, how can I get a pointer on my array of bytes ? Thanks. Karl -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 R Graph Gallery: http://gallery.r-enthusiasts.com blog:

Re: [Rd] Interfacing a C++ class

2011-06-06 Thread Romain Francois
# create an instance f <- new( FOO, 2.0, 3.0 ) # call an R method f$reset() # call a C++ method f$move( 2.0, 2.0 ) # call an R method f$bla() Hope this helps. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr http://romain-francois.com |-

Re: [Rd] assignInNamespace and new bindings

2011-05-31 Thread Romain Francois
Le 31/05/11 12:01, Prof Brian Ripley a écrit : On Tue, 31 May 2011, Prof Brian Ripley wrote: On Tue, 31 May 2011, Romain Francois wrote: Hello, assignInNamespace refuses to assign an object to a name that is not already used in the namespace. That's intentional, and as docum

Re: [Rd] serialization of external pointers

2011-05-26 Thread Romain Francois
Le 26/05/11 17:04, Simon Urbanek a écrit : On May 26, 2011, at 10:40 AM, Romain Francois wrote: Hello, I'm looking for examples of how to handle serialization of external pointers. We use external pointers intensively in Rcpp for modules and one popular request is to have persistence

Re: [Rd] Recursively parsing srcrefs

2011-05-12 Thread Romain Francois
} That last display looks like a bug indeed. I'll take a look. The key seems to be a leading newline: parse(text = "\nx") parse(text = "x") Hadley -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr http://romain-

Re: [Rd] Create and access several instances of a C++ class from R

2011-05-07 Thread Romain Francois
instantiated from ‘T Rcpp::as(SEXPREC*) [with T = double*]’ /Library/Frameworks/R.framework/Versions/2.13/Resources/library/Rcpp/include/Rcpp/module/Module_generated_CppMethod.h:122: instantiated from ‘SEXPREC* Rcpp::CppMethod1::operator()(Class*, SEXPREC**) [with Class = Foo, U0 = double*]’ Fo

[Rd] as.environment.list provides inconsistent results under torture

2011-01-11 Thread Romain Francois
*envir = */R_NilValue, /* parent = */R_EmptyEnv), rho)); } (BTW, this was detected in a long Rcpp-devel thread. See http://comments.gmane.org/gmane.comp.lang.r.rcpp/1336) Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://rom

Re: [Rd] embed Sweave driver in .Rnw file

2010-12-14 Thread Romain Francois
Le 14/12/10 13:21, Friedrich Leisch a écrit : On Tue, 14 Dec 2010 12:40:04 +0100, Romain Francois (RF) wrote: > Hello, > Sweave lets you use alternative drivers through the driver argument, and > several packages take advantage of that and define custom Sweave driver

[Rd] embed Sweave driver in .Rnw file

2010-12-14 Thread Romain Francois
: > Sweave( "somefile.Rnw" ) the highlight driver is used instead of the default driver. Could something like that be added to Sweave ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/fT2rZM : highligh

[Rd] Enough (was: Terminology clarification (Re: GPL and R Community Policies (Rcpp))

2010-12-04 Thread Romain Francois
ecause I was being > forced to compete with my own work, not a pleasant place to be. > > Are you telling me that you refuse to stop using my name > in Rcpp (except in copyright notices)? > > Are you telling me that you will continue to use my name and > update the associate

Re: [Rd] faster base::sequence

2010-11-28 Thread Romain Francois
Le 28/11/10 11:30, Prof Brian Ripley a écrit : On Sun, 28 Nov 2010, Romain Francois wrote: Le 28/11/10 10:30, Prof Brian Ripley a écrit : Is sequence used enough to warrant this? As the help page says Note that ‘sequence <- function(nvec) unlist(lapply(nvec, seq_len))’ and it mainly exi

Re: [Rd] faster base::sequence

2010-11-28 Thread Romain Francois
'm not really comfortable with .Internal, etc ... Do you mean that I should also use something else instead of "int" and "int*". Is there some future proof typedef or macro for the type associated with INTSXP ? On Sun, 28 Nov 2010, Romain Francois wrote: Hello, Ba

[Rd] faster base::sequence

2010-11-28 Thread Romain Francois
0) sequence(1:10) ) utilisateur système écoulé 0.119 0.000 0.119 > > system.time( for( i in 1:1) sequence_c(1:10) ) utilisateur système écoulé 0.019 0.000 0.019 I would write a proper patch if someone from R-core is willing to push it. Romain

Re: [Rd] How to call R from C

2010-11-22 Thread Romain Francois
:Function class. require(inline) fx <- cxxfunction( , ' // grab the function Function rnorm("rnorm") ; // call it return rnorm(10, _["sd"] = 10) ; ' , plugin = "Rcpp" ) fx() Romain -- Romain Francois Professional

Re: [Rd] Reference classes: accessor functions via 'getRefClass(...)$accessors(...)'

2010-11-17 Thread Romain Francois
issing( value ) ){ read.table( file ) } else{ write.table( value, file = file ) } } ) ) foo <- Foo$new( file="/tmp/iris.txt" ) foo$x <- iris foo$x write.table( subset( iris, Petal.Length < 2), file = "/

Re: [Rd] R5 reference classes: how to initialize exactly?

2010-11-17 Thread Romain Francois
S4: setClass("Blabla", .) x<- new("Blabla") R5: MyRefObj<- setRefClass("Blabla", .) x<- MyRefObj$new(.) But then how do I define a reference class in a package that should be available after the package is loaded via 'library(my_pkg)' as ther

Re: [Rd] SEXP and slots

2010-11-16 Thread Romain Francois
Le 15/11/10 21:15, Romain Francois a écrit : Hello, Since people have whisperred about Rcpp, I'd like to play too. On 11/15/2010 07:45 AM, Patrick Leyshock wrote: Very helpful, thank you. A couple other questions, please: 1. I've got a function written in C, named "my_c_fun

Re: [Rd] SEXP and slots

2010-11-15 Thread Romain Francois
oal in mind, and this is too much information... Martin > > Thanks, Patrick > > [[alternative HTML version deleted]] > > __ > R-devel r-project.org <mailto:R-devel r-project.org> mailing

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

2010-09-22 Thread Romain Francois
quot;, ".Rcheck/Foo") >> > Error in library.dynam.unload("Foo", ".Rcheck/Foo") : >> > shared library 'Foo' was not loaded >> > >> > # using an absolute path works >> > >library.dynam.unload("Foo", &quo

[Rd] list2env( list() )

2010-09-15 Thread Romain Francois
(x)).")); envir = CAR(args); args = CDR(args); if (TYPEOF(envir) == NILSXP) { Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/cCmbgg : Rcpp 0.8.6 |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 `- ht

Re: [Rd] C or Java code generation

2010-08-20 Thread Romain Francois
lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : hi

Re: [Rd] Defining a method that behaves like '$'?

2010-07-09 Thread Romain Francois
ans parse(text = "a$$name") : '$' inattendu(e) dans "a$$" But you can define custom methods for $. setClass( "Foo", representation( n = "integer" ) ) setMethod( "$", "Foo", function(x, name ){ function( ) rnorm( x...@n

Re: [Rd] nchar( NA )

2010-06-18 Thread Romain Francois
ected behavior. Oops. My scan of the help page was too quick. I did not see it. Sorry for the noise. Sarah On Fri, Jun 18, 2010 at 4:52 PM, Romain Francois wrote: Hello, Is this expected ? nchar( c( "", NA ) ) [1] 0 2 Should not the second one be NA ? Romain -- Romain Franco

[Rd] nchar( NA )

2010-06-18 Thread Romain Francois
Hello, Is this expected ? > nchar( c( "", NA ) ) [1] 0 2 Should not the second one be NA ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph gallery co

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

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

2010-05-30 Thread Romain Francois
powerful if it were accompanied by a patch that could be applied to the R sources? Best wishes Wolfgang Huber EMBL http://www.embl.de/research/units/genome_biology/huber On 28/05/10 19:25, Romain Francois wrote: Hello, I often find myself writing code like : if( require( "foo" ) &&a

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

2010-05-29 Thread Romain Francois
1] "foo" > > ff = new("foo") > > setClass("fee", contains = "foo") [1] "fee" > > fe = new("fee") Both ff$ and fe$ complete with "bar", running 2.11.0 from the command line. John On 5/29/10 12:37 P

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

[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

[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

Re: [Rd] R 2.10 and help

2010-05-27 Thread Romain Francois
server does actually generating the html - see tools:::httpd -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/cork4b : highlight 0.1-8 |- http://bit.ly/bklUXt : RcppArmadillo 0.

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] Use of R and Rscript in configure/Makevars in packages

2010-05-20 Thread Romain Francois
'Writing R Extensions' manual for how to achieve this. (The reason is that configure.win is called once, and then src/Makevars.win is called for each architecture.) BDR -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bi

[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] Memory allocation in C/C++ vs R?

2010-05-01 Thread Romain Francois
In both of these cases the R-provided functions are not used (to my knowledge), yet I have not seen any problems. How is the memory that R manages and garbage collects kept separate from the memory that is allocated on the C++ side quite independently of what R is doing? Th

Re: [Rd] RInside & child threads

2010-05-01 Thread Romain Francois
that this initialization need to be made after the RInside constructor is called. I did that, but it still does not work. Can you please let me know how do we accomplish this task? Thanks very much, Jai -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog

Re: [Rd] RInside & child threads

2010-05-01 Thread Romain Francois
that this initialization need to be made after the RInside constructor is called. I did that, but it still does not work. Can you please let me know how do we accomplish this task? Thanks very much, Jai -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog

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

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

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] for help on building a R package with several R function and a bunch of c, c++

2010-03-07 Thread Romain Francois
ce between my first name and last name..  All I tried are on my own PC at home , I will tryon other  PC in my office.  Do you have suggestion?. Thanks,  Alex --- On Sun, 3/7/10, Romain Francois wrote: From: Romain Francois Subject: Re: [Rd] for help on building a R package with seve

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

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

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

2010-03-03 Thread Romain Francois
yrfr I am looking for a mentor to guide me through the summer on the project under the Google Summer Of Code program (GSOC 2010) with relevant experience in Symbolic Regression or Genetic Programming in general. Chillu -- Romain Francois Professional R Enthusiast +33(0) 6 28 91

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

2010-02-20 Thread Romain Francois
g namespace Rcpp; Environment global = Environment::global_env() ; CharacterVector x(2) ; x[0] = "foo" ; x[1] = "bar" ; global["x"] = x ; -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster image

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

2010-02-14 Thread Romain Francois
method' in specified packages and libraries: you could try '??S3method' I don't understand why S3method is necessary. My understanding is that we can always use print.foo(} # and appropriate exporting to replace S3method(print, foo) , right? Or I misunderstand somethi

Re: [Rd] Portability of a C function

2010-02-14 Thread Romain Francois
-- void f2(x,y,z){ double result; result = f1(x,y); } Thanks Christophe -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/O1wO : highlight 0.1-5 |- http://tr.im/O1qJ : Rcpp 0.7.6 `- http://tr.im/N

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] LinkingTo and C++

2010-02-11 Thread Romain Francois
ally using the LinkingTo: facilities for the functions so it's essentially just helping you to find the header file. Cheers, Simon On Feb 11, 2010, at 4:08 AM, Romain Francois wrote: Hello, I've been trying to make LinkingTo work when the package linked to has c++ code. I'v

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 {

[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] R CMD check error with the GNU Scientific Library

2010-01-22 Thread Romain Francois
Makevars they have "PKG_CFLAGS = -I./gsl". I have copied this approach, but wonder if using the standard "R CMD build myPackage" "R CMD check myPackage" needs modifying in some way? All hints or ideas welcome. Thanks David -- Romain Francois Professional R E

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

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

2010-01-14 Thread Romain Francois
s I am thinking about reoganizing that package to minimize confusion with the fork. Thanks, Dominick On Thu, Jan 14, 2010 at 7:16 AM, Romain Francois mailto:romain.franc...@dbmail.com>> wrote: On 01/14/2010 12:42 PM, Laurent Gautier wrote: Hi, In Rcpp, we n

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

2010-01-14 Thread Romain Francois
;do_try_eval". The behavior looks very similar, the above snippet in rpy2 would write like: from rpy2.robjects.packages import importr stats = importr('stats') stats.rnorm(10, 0.0) nice -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.

[Rd] how to call a function from C

2010-01-14 Thread Romain Francois
Function rnorm = stats.get( "rnorm" ) return rnorm( 10, 0.0 ) ; -- 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 : External pointers with

Re: [Rd] Is nested namespace supported?

2010-01-09 Thread Romain Francois
o::bar::" > parse( text = "foo:::bar:::foobar" ) Error in parse(text = "foo:::bar:::foobar") : unexpected ':::' in "foo:::bar:::" Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr

Re: [Rd] PROTECT and OCaml GC.

2010-01-09 Thread Romain Francois
the commutation context somewhere in the evaluation mechanism of R itself. The API doesn't support that, I guess. -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/JOlc : External pointers with Rcpp |- http://tr.im/JFqa : R

Re: [Rd] R object protection [Was: R-devel Digest, Vol 83, Issue 2]

2010-01-03 Thread Romain Francois
> as.vector(x) [1] 1 3 4 6 7 8 9 10 11 12 13 14 15 17 18 19 20 no magic however since C++ reflection capabilities are very limited, well some magic based on the brew package. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http:/

  1   2   3   >