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
. Romain > Le 24 sept. 2019 à 07:48, Gabriel Becker a écrit : > > Hi Bob, > > Thanks for sending around the link to that. It looks mostly right and looks > like a useful onramp. There are a few things to watch out for though (I've > cc'ed Romain so he's awar

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

2019-03-30 Thread Romain Francois
POC data structures. This is similar to precautions you’d take when writing concurrent code. Romain > Le 30 mars 2019 à 00:58, Simon Urbanek a écrit : > > Kevin, > > >> On Mar 29, 2019, at 17:01, Kevin Ushey wrote: >> >> I think it's also worth saying t

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

2018-10-10 Thread Romain Francois
t; We have to do something like this unless we depend on R 3.6.0: #if R_VERSION < R_Version(3, 6, 0) #define class klass extern "C" { #include } #undef class #else #include #endif Romain > Le 9 oct. 2018 à 05:09, Tierney, Luke a écrit : > > Thanks for

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 François
> Le 5 nov. 2014 à 14:45, Dirk Eddelbuettel a écrit : > > > On 5 November 2014 at 14:11, Romain Francois wrote: > | > Le 5 nov. 2014 à 13:43, Dirk Eddelbuettel a écrit : > | > You are NOT forced or required to use the Boost distributions header __as > R >

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] Linking to the BH package introduces CRAN warnings

2014-11-04 Thread Romain François
> Le 4 nov. 2014 à 21:52, kaveh a écrit : > > > Dear Romain, > > > > You’re kind of out of luck. These functions are both: > - used by the boost headers > - forbidden by R, well at least forbidden by CRAN > > > Thanks for conforming my earlier fea

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

2014-11-04 Thread Romain François
> Le 4 nov. 2014 à 15:42, Dirk Eddelbuettel a écrit : > > > On 4 November 2014 at 14:37, kaveh wrote: > | Dear all, > | > | I'm working on a project that links to the BH package > | (http://cran.r-project.org/web/packages/BH/index.html). > | > | My packages doesn't call entry points which mig

Re: [Rd] Using Rtools with gcc 4.8.3

2014-10-05 Thread Romain François
Le 5 oct. 2014 à 13:56, Romain François a écrit : > > Le 5 oct. 2014 à 13:14, Gabor Grothendieck a écrit : > >> On Sun, Oct 5, 2014 at 6:51 AM, Uwe Ligges >> wrote: >>> >>> >>> On 05.10.2014 12:20, Jeroen Ooms wrote: >>>> >

Re: [Rd] Using Rtools with gcc 4.8.3

2014-10-05 Thread Romain François
le as > part of Rtools. +1. Please. I’d like a newer gcc as part of Rtools too. My reason for it is that it would bring actual C++11, rather than unfinished C++0x as gcc 4.6.3 currently ships. That would allow more adoption of the newer C++ standard for packages [*]. Furthermore, a curren

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 François
Le 24 juin 2014 à 14:58, Simon Urbanek a écrit : > On Jun 24, 2014, at 9:21 AM, Romain Francois wrote: > >> Hi, >> >> Can you give us what str on the returned object gives you? >> >> I think you need : >> >> SET_OBJECT(and, 1) ; >&

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_

Re: [Rd] operation on ‘numsels’ may be undefined

2014-06-23 Thread Romain François
Le 23 juin 2014 à 18:28, cstrato a écrit : > Dear Romain, > > Thank you for your suggestions, I like especially the first one. > > However, you did not explain why I have never got this warning message on any > compiler, and why only one of the two identical Ubuntu compiler

Re: [Rd] operation on ‘numsels’ may be undefined

2014-06-23 Thread Romain François
e. perhaps you don’t have a C++11 compiler, so perhaps one of these depending on what is arrMask: Int_t numsels = std::count( arrMask.begin(), arrMask.end(), 1 ) ; Int_t numsels = std::count( arrMask, arrMask + size, 1 ) ; Romain > Even on the recently added release server 'zin2'

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

2014-04-11 Thread Romain Francois
, you have to change the way you approach the sequence of things that go on. Particularly it is less of a problem to do a double pass, i.e. one to figure out the appropriate size and one to handle part of the data. And guess what, there is lots of that to come in next versions of Rcpp11. Romain

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

2014-04-10 Thread Romain François
in poor for some time > to come, I'm afraid. > > Martyn What would be a good enough motivation for distributing a version of Rtools based on a more recent gcc, e.g. in the 4.8 series, which has much better coverage of the standard. I don’t have the skills to build an Rtools d

Re: [Rd] question regarding lang2 command in C

2014-04-02 Thread Romain François
ll("gender")) ; SET_TAG(CDR(CDDR(call)), install("stringsAsFactors")) ; SEXP df = PROTECT(eval(call, R_GlobalEnv)) ; UNPROTECT(2) ; return df ; Or you can use Rcpp: DataFrame df = DataFrame::create( _["age"] = age, _["gender"] = gender,

[Rd] special handling of row.names

2014-04-01 Thread Romain François
ata.frame" ), eventually this line is executed: attributes(.Data) <- c(attributes(.Data), attrib) So, first attributes are retrieved, and because of R special handling of row.names, it gets promoted to 1:n in getAttrib. Then, we want to set the row.names attribute, special handling again in

Re: [Rd] internal string comparison (Scollate)

2014-03-31 Thread Romain François
may be the R way of doing things, but sometimes it is a waste of both memory and time. Yes, this is about performance. We are often asked to choose between performance and correctness when in fact we can have both. Romain Le 27 mars 2014 à 22:12, Duncan Murdoch a écrit : > On 14-03-27 3:0

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

2014-03-31 Thread Romain François
n available. But from >> a global perspective you should think of >> C++98 and C++11 as two different languages. >> >> Martyn >> >> >> From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on >> behalf of

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

2014-03-30 Thread Romain Francois
to either unordered_map or tr1::unordered_map, all the condition compiling is done in Rcpp. Romain Le 30 mars 2014 à 21:50, Martin Morgan a écrit : > In C++ code for use in a R-3.1.0 package, my specific problem is that I would > like to use if it is available, or if > not, or if

Re: [Rd] internal string comparison (Scollate)

2014-03-26 Thread Romain François
Le 26 mars 2014 à 18:03, Gabriel Becker a écrit : > On Wed, Mar 26, 2014 at 9:50 AM, Dirk Eddelbuettel wrote: > > On 26 March 2014 at 17:22, Romain François wrote: > | I’d like to compare two strings internally the way R would, so I need > Scollate which is not part of the a

[Rd] internal string comparison (Scollate)

2014-03-26 Thread Romain François
. Romain PS: Here is some context: https://github.com/hadley/dplyr/issues/325 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

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

2014-03-19 Thread Romain Francois
. : Depends: R (== 3.1.0) ? Romain For example, personally I’m waiting for 3.1.0 for releasing Rcpp11 because I want to leverage some C++11 support that has been included in R. It has been frustrating to have to wait, but it does change the way I make changes to the codebase. Perhaps it is a good habit

Re: [Rd] help with gotoExitingHandler(R_NilValue, call, entry); . Implementation of error handling internally

2014-02-27 Thread Romain François
Never mind. For my initial question, I can just use: R_curErrorBuf My current implementation now only depend on R_FunTab and R_GlobalContext which R does not conceal behind attribute_hidden. https://github.com/romainfrancois/Rcpp11/blob/master/inst/include/Rcpp/Context.h Romain Le 27 févr

Re: [Rd] help with gotoExitingHandler(R_NilValue, call, entry); . Implementation of error handling internally

2014-02-26 Thread Romain François
condition where R_ToplevelExec would return TRUE. Would someone be willing to review a patch to R with this added functionality. Please. In any case, I still would like some comments about my initial question about R_NilValue use in gotoExitingHandler(R_NilValue, call, entry); Romain Le 26 févr

[Rd] help with gotoExitingHandler(R_NilValue, call, entry); . Implementation of error handling internally

2014-02-26 Thread Romain François
eError, this is just making a simple VECSXP with names and classes, no big trouble here. Romain __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

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
. https://github.com/romainfrancois/Rcpp11/blob/master/inst/include/Rcpp/Promise.h#L14 So, this is something I find useful, although I’m not sure we are supposed to mess with promises. Romain Le 11 févr. 2014 à 19:02, Michael Lawrence a écrit : > Hi all, > > It seems that there

[Rd] LinkingTo self

2014-02-03 Thread Romain Francois
automatic ? So if a package has src/ and inst/include/ can we have it so that a -I flag is set accordingly. Would anyone be interested in reviewing a patch against R-devel for such feature ? Romain __ R-devel@r-project.org mailing list https

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

2014-01-22 Thread Romain François
face between the two packages to be at low level (not visible from R), then you don’t need to conform to the SEXP(SEXP...) interface. You can use anything you like. Romain Le 22 janv. 2014 à 19:56, Gregor Kastner a écrit : > Hi again, > > On Wed, 22 Jan 2014 06:39:17 -060

Re: [Rd] External pointers and changing SEXPTYPE

2013-12-16 Thread Romain François
happened to Rcpp. Romain Le 16 déc. 2013 à 12:07, Krzysztof Mlynarczyk a écrit : > As far as I understood the documentation, external pointer should be > automatically protected from gc when returned to environment. The > solution you've just suggested would cause stack imbalance. &

Re: [Rd] internal manipulation of ...

2013-12-14 Thread Romain François
Thanks. This works for me. See this gist: https://gist.github.com/romainfrancois/7959531 Romain Le 13 déc. 2013 à 01:09, Hadley Wickham a écrit : > Could you pass the environment and then look for the object called ... in it? > > f <- function(...) { > .Call("

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] internal manipulation of ...

2013-12-12 Thread Romain François
Le 13 déc. 2013 à 00:15, Simon Urbanek a écrit : > > On Dec 12, 2013, at 3:32 PM, Romain François wrote: > >> Hello, >> >> I’m looking for examples on how to manipulate the ... internally, e.g. in a >> .Call or .External function. >> >>

[Rd] internal manipulation of ...

2013-12-12 Thread Romain François
sys.frames() down to the C function. The documentation in http://cran.r-project.org/doc/manuals/R-ints.html#Dot_002ddot_002ddot-arguments did not help me a lot. Romain __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

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
] > f <- local( { + x <- 1 + function(v) { +if (missing(v)) +cat("get\n") +else { +cat("set\n") +x <<- v +} +x + } + }) > makeActiveBinding("fred", f, .GlobalEnv) > bindingI

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
f we could make this more transparent, i.e. having LinkingTo: Rcpp mean loading Rcpp. I'm also curious about this sentence from the doc: "In the future R may provide some automated tools to simplify exporting larger numbers of routines." Is there a draft of something ? Romain

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
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 code, it is actually quite simpler to learn c++ t

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

2013-11-07 Thread Romain Francois
data structures that know how to grow efficiently, i.e. a std::vector and then convert that to an R vector when you're done with them. Romain Le 07/11/2013 14:03, George Vega Yon a écrit : Hi! I didn't wanted to do this but I think that this is the easiest way for you to unders

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

2013-11-04 Thread Romain Francois
#x27;t require other external libraries like boost. +1 portability is really important. One of the points is that by giving means to assume a certain standard, we can write more portable code. There has been lots of discussion about Boost.Thread, etc ... no need for that if you have C++11.

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

2013-10-28 Thread romain
anything I can do to help, please let me know. Come here https://github.com/romainfrancois/cpp11_article where I'm writing an article on C++11 and what would be the benefits. Romain Sincerely, Whit On Mon, Oct 7, 2013 at 5:47 PM, Dirk Eddelbuettel wrote: Hi Martyn, On 7 October

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
e function pointer so you don't have to search for it with its name. Romain Le 02/10/13 19:45, Duncan Murdoch a écrit : Thanks Dirk, Martyn and Romain. I'm planning to do a temporary workaround release with the Shape class renamed to rglShape, but over the longer term I'll p

Re: [Rd] C++ debugging help needed

2013-10-02 Thread Romain Francois
7;t see R_RegisterCCallable either) ... Romain On 02/10/2013 10:50 AM, Duncan Murdoch wrote: I've had reports lately about segfaults in the rgl package. I've only been able to reproduce these on Linux. I am not so familiar with C++ details, so I have a couple of questions way down b

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

2013-09-19 Thread Romain Francois
y are guaranteed to be different types and i dont need to resort to configure voodoo, i can just rely on the compiler and its preprocessor. Romain Le 20 sept. 2013 à 04:04, Karl Millar a écrit : > Romain, > > Can you use int64_t and uint_t64 instead? IMHO that would be more usefu

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

[Rd] Using long long types in C++

2013-09-19 Thread romain
can use it given that we test for a compiler (gcc) and its known way to check for existence of long long: __LONG_LONG_MAX__ What are my options here ? Romain __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Get the tail of a list in C

2013-07-05 Thread romain
Le 2013-07-05 07:15, maxpar a écrit : Hi, I am write R extensions in C. Now I have a VECSXP variable, so how can I get the tail of it (all but the first one) as a new VECSXP. I tried CDR(), but it gives error. Thanks. Hello, A VECSXP is actually an array of pointers, not a linked list. If

Re: [Rd] compiling Rcpp with 3.0.1 on Solaris 10

2013-06-22 Thread romain
that are worth looking at. Best regards, Romain Le 2013-06-21 14:25, MAYER Hans a écrit : Hello My colleagues asked me to install "R" with module "shiny". R version 3.0.1 compiled fine on Solaris 10 and is running well. I tried to install "shiny". With the

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

2013-06-20 Thread Romain Francois
are possibly relevant: finalize, get_used, initialize > b$get_used() [1] 0 Romain Le 19/06/13 16:14, Tee-Jay-Ardie a écrit : Hi there, Although I'm a quite experienced R user and know my ways in C, I stumbled upon a problem I don't know how to solve. Therefore, I hope someone

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

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

2013-02-01 Thread Romain Francois
Hello, That is a bug in inline indeed. I just commited a fix in r-forge. The fix is to obviously replace this as.character by an as.raw. Thanks for teh report. Romain Le 01/02/13 10:25, Karl Forner a écrit : Hello, From what I understood from the documentation I found, when using the

Re: [Rd] reinterpreting externalptr in R

2012-12-26 Thread romain
iew=markup&root=rcpp This simply builds on the macros that the R api offers, so perhaps "writing R extensions" or "R internals" are good sources of information. Romain Le 2012-12-25 18:15, Simon Urbanek a écrit : On Dec 25, 2012, at 6:39 AM, andre__ wrote: Hi, I am us

Re: [Rd] extending the colClasses argument in read.table

2011-11-21 Thread romain
Thanks gabor, I will implement this and publish an updated package later. Cheers, Romain Le 21 nov. 2011 à 16:31, Gabor Grothendieck a écrit : > 2011/11/21 Romain François : >> Hello, >> >> We've released the int64 package to CRAN a few days ago. The pack

[Rd] extending the colClasses argument in read.table

2011-11-21 Thread Romain François
4 ], as.uint64 ) } df } else { read.csv( file, ... ) } } I was wondering if it would make sense to extend the colClasses argument so that other package can provide drivers, so that we could let the users just use read.csv, read.table, etc ... Before I sta

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
MENT TRUE # two 15 50 0 51 141 26 30 0 ')' TRUE ) 16 23 3 44 477 27 30 0 exprFALSE 17 14 4 51 177 30 32 0 exprFALSE 18

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

2011-05-07 Thread Romain Francois
* data, int n){ double sum = 0.0 ; for( int i=0; iI hope this helps, please send other Rcpp questions to the Rcpp-devel mailing list, where you have more chances to have replies. As an example, I don't follow R-devel as much as I would like to these days. Romain Le 07/05/11 10:41, soe

[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
the Rcpp-devel mailing list. Regards, Romain $ grep -R Samperi * | grep -v .svn DESCRIPTION: 'classic Rcpp API' was written during 2005 and 2006 by Dominick Samperi. debian/copyright:R / C++ interface package. Rcpp was written by Dominick Samperi, debian/copyright: 2005 and 2

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
capability to do so technically). Reference classes are just an addition to S4. Cheers, Simon Thanks for that clarification. I picked that name up from the Google TechTalks presentation of Dirk and Romain. So I refer to them as S4 reference classes in future posts? Regards, Janko Sorry about t

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
x <- cxxfunction( signature(x = "example"), ' S4 obj(x) ; obj.slot( "size" ) = 10 ; obj.slot( "id" ) = "foo" ; return obj ; ', plugin = "Rcpp" ) str( fx( new("example", size=4, id="id_value") ) ) B

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

2010-09-22 Thread Romain Francois
2.12.0, we have currently a few issues to deal with due to the use of a newer compiler for R 2.12.0. We hope we can make this happen before R 2.12.0 is out next month. Romain but I did try it in R-patched. With one minor change to your script (the lib.loc needs to be "local", not &q

[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
ot; in the sense that the compiles and linking steps succeed (WinXP, Rtools with gcc/g++ 4.2.x, R 2.11.0) yet it, as noted above, leads to a seg.fault which Romain and I have found neither time nor motivation to fix. You would be very welcome to help out -- our discussions around Rcpp and RInside tak

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
Le 18/06/10 22:58, Sarah Goslee a écrit : Hi Romain, Did you read the help for nchar? Value: For ‘nchar’, an integer vector giving the sizes of each element, currently always ‘2’ for missing values (for ‘NA’). It may be unexpected behavior, but it's *well-documented* unexp

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

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

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

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

  1   2   3   4   >