Re: [Rd] [R] Problems when trying to install and load package "rzmq"

2017-01-03 Thread Whit Armstrong
sounds great! On Tue, Jan 3, 2017 at 11:32 AM, Jeroen Ooms wrote: > On Tue, Jan 3, 2017 at 3:53 PM, Whit Armstrong > wrote: > > > > I maintian the rzmq project. > > > > love to get it running on windows, but zmq doesn't play nicely with R's > > m

Re: [Rd] [R] Problems when trying to install and load package "rzmq"

2017-01-03 Thread Whit Armstrong
Hi, Paul. I maintian the rzmq project. love to get it running on windows, but zmq doesn't play nicely with R's mingw. These guys have taken the approach of building the entire zmq library inside the R package: https://github.com/snoweye/pbdZMQ I suggest you give it a try. or if you want to atte

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

2013-10-28 Thread Whit Armstrong
I would love to see optional c++0x support added for R. If there is anything I can do to help, please let me know. Sincerely, Whit On Mon, Oct 7, 2013 at 5:47 PM, Dirk Eddelbuettel wrote: > > Hi Martyn, > > On 7 October 2013 at 21:18, Martyn Plummer wrote: > | I don't see any harm in allowin

[Rd] test suites for packages

2012-05-17 Thread Whit Armstrong
Can anyone share some opinions on test suites for R packages? I'm looking at testthat and RUnit. Does anyone have strong opinions on either of those. Any additional packages I should consider? Thanks, Whit __ R-devel@r-project.org mailing list https:/

[Rd] R CMD check -- non S3 method warning

2012-04-21 Thread Whit Armstrong
I'm trying to R CMD check a package, and I'm getting the 'checking S3 generic/method consistency' warning. I have written a function 'gamma.dist' which is _not_ an S3 method, but happens to collide with the 'gamma' function from the R::base namespace. Is there a way of telling CMD check that the

Re: [Rd] eval a SYMSXP from C

2012-04-16 Thread Whit Armstrong
Thanks, Duncan. Your suggestion works. And thanks for the hint, about the env. I suppose I should preserve the env of the original function where the substitute was called... Cheers, Whit On Mon, Apr 16, 2012 at 8:01 PM, Duncan Murdoch wrote: > On 12-04-16 5:53 PM, Whit Armstrong wr

[Rd] eval a SYMSXP from C

2012-04-16 Thread Whit Armstrong
Can someone offer some advice on how to properly evaluate a SYMSXP from a .Call ? I have the following in R: variable xn, with an attribute "mu" which references the variable mu in the global environment. I know "references" is a loose term; mu was defined in this fashion as a way to implement d

Re: [Rd] drawing the graph with many nodes

2012-03-27 Thread Whit Armstrong
if you don't mind going outside of R to create it, then check out Graphviz: http://www.graphviz.org/Gallery.php you may have to reformat your data a little, but this tool is great for drawing graphs. -Whit On Tue, Mar 27, 2012 at 5:14 AM, MSousa wrote: > Good morning, > > > I'm trying to draw

Re: [Rd] Serializing many small objects efficiently

2012-03-22 Thread Whit Armstrong
Here's a snip from r-hcp. You can probably find it in the archive: From: Michael Spiegel Date: Thu, Sep 29, 2011 at 11:38 AM Subject: RE: [R-sig-hpc] [zeromq-dev] rzmq package Calling serialize/serialize from c/c++ is not too convoluted. You can find a good example in https://github.com/mspiegel/

Re: [Rd] advice on writing/maintaining an R package with a version control system

2010-09-16 Thread Whit Armstrong
Since you are using git you may want to consider a submodule for your project. It is often helpful to build a full library in c++ complete with it's own unit tests. You can then package this library inside of your R project as a submodule. This can speed up the testing phase of the project b/c y

Re: [Rd] R_PreserveObject, R_ReleaseObject : reference counting needed ?

2010-01-02 Thread Whit Armstrong
Romain, > that's not what I said. It just felt not as easy to use as just grab a SEXP > and say R_PreserveObject( x ) and then later R_ReleaseObject. Didn't mean to suggest that you said that. I was asking the list whether it's discouraged. Will follow up on the Rcpp list. -Whit _

Re: [Rd] R_PreserveObject, R_ReleaseObject : reference counting needed ?

2010-01-02 Thread Whit Armstrong
Romain, Is the use of UNPROTECT_PTR discouraged? I wonder why you haven't considered using it instead. I have a similar project that uses a ref counting scheme and handles the deletion of the shared object with UNPROTECT_PTR. This method has been working fine, but if there are reasons I should

Re: [Rd] Which packages in R use C++?

2009-12-11 Thread Whit Armstrong
and fts, making heavy use of templates for R types: http://github.com/armstrtw/fts -Whit On Thu, Dec 10, 2009 at 4:16 PM, Dirk Eddelbuettel wrote: > > On 10 December 2009 at 15:02, Peng Yu wrote: > | I want to see some working examples on how to call C++ programs from > | R. Could somebody let

Re: [Rd] PROTECT and OCaml GC.

2009-11-28 Thread Whit Armstrong
I've had success w/ using a reference counting paradigm in which the outside memory manager calls UNPROTECT_PTR(R_object_); in its destructor. So, in my case (using c++ ) if objects are allocated on the heap, which allocate R objects as their backend storage, I don't have to worry about out of ord

Re: [Rd] destructor for S4 class objects in analogy to C++

2009-07-21 Thread Whit Armstrong
if you are using external pointers, then R allows you to set a finalizer function to be called on the pointer. http://cran.r-project.org/doc/manuals/R-exts.html#External-pointers-and-weak-references see examples in RODBC package. and here too: see the "connFinalizer" function http://github.com/a

Re: [Rd] Memory management issues

2009-07-05 Thread Whit Armstrong
If you are in control of the c++ library (i.e. it is not from a vendor), then you can also override the new operator of your object so that it allocates an SEXP. if you implement PROTECT/UNPROTECT calls correctly, then GC will not be a problem. The approach that I've taken with my time series lib

Re: [Rd] beginner's guide to C++ programming with R packages?

2009-06-26 Thread Whit Armstrong
> But this draws me back to the basic question.  I don't want to run R > CMD INSTALL 20 times per hour.  How do developers "actually" test > their code? check out RUnit for tests. http://cran.r-project.org/web/packages/RUnit/index.html as for testing c++ code. I have taken an approach which is p

Re: [Rd] what is the preferred method to create a package local variable?

2009-04-02 Thread Whit Armstrong
onments can be changed. > > -roger > > On Thu, Apr 2, 2009 at 9:41 AM, Whit Armstrong > wrote: >> Thanks to everyone for the suggestions. >> >> The package local environment (per Roger Peng) works well. >> .localstuff <- new.env() >> .localstuff$bbg.db.con

Re: [Rd] what is the preferred method to create a package local variable?

2009-04-02 Thread Whit Armstrong
> > Philippe Grosjean > > > Roger Peng wrote: >> >> I usually use environments for this. So, in one of the R files for the >> package, just do >> >> .localstuff <- new.env() >> >> Then, in functions you can do things like >> >> .localstu

[Rd] what is the preferred method to create a package local variable?

2009-03-31 Thread Whit Armstrong
for the moment, I'm using: .onAttach <- function(libname, pkgname) { .bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah") } .onUnload <- function(libpath) { dbDisconnect(.bbg.db.conn) } which results in a hidden global variable in the global environment. I would prefe

[Rd] question on "row.names" attribute of dataframe when called from a compiled package

2009-03-17 Thread Whit Armstrong
Why does the following show a class attribute of "character" when using the interpreter: x <- data.frame(hat=1:10) class(rownames(x)) ## returns [1] "character" but when called from c/cpp, the rownames attribute has no class attribute, and is in fact a vector of INTSXP? > .Call("print_class_of_

Re: [Rd] Function to recognise convert dates between gregorian and other calendars (e.g. Persian)?

2009-01-07 Thread Whit Armstrong
probably easy to do w/ Boost DateTime http://www.boost.org/doc/libs/1_37_0/doc/html/date_time.html for which there is already an R package in development: http://repo.or.cz/w/RBoostDateTime.git I'm happy to write a small wrapper to do what you want if you can offer a pseudocode example of the co

Re: [Rd] any suggestions to deal with 'Argument list too long' for a R CMD check?

2008-12-10 Thread Whit Armstrong
changing the build script to link the files incrementally (is that possible). To my knowledge no other packages out there have such an insane amount of files. -Whit On Tue, Dec 9, 2008 at 5:59 PM, Whit Armstrong <[EMAIL PROTECTED]> wrote: > Thanks for the link, Prof. Ripley. > >&

Re: [Rd] any suggestions to deal with 'Argument list too long' for a R CMD check?

2008-12-09 Thread Whit Armstrong
Thanks for the link, Prof. Ripley. > What I suspect is happening is that there is a link command starting with > 'g++' that is too long. > One useful ref: http://www.in-ulm.de/~mascheck/various/argmax interesting... on my system: [EMAIL PROTECTED] src]$ getconf ARG_MAX 131072 [EMAIL PROTECTED]

Re: [Rd] any suggestions to deal with 'Argument list too long' for a R CMD check?

2008-12-09 Thread Whit Armstrong
t; have the c compiler installed but not the c++ compiler) > > > > Maybe it will be worthwhile to check if you have installed every required > header files or needed compilers/libraries. > But as I mentioned, this is just a suggestion. > Cheers, > Mathieu > > Whit Armstrong a écrit

Re: [Rd] any suggestions to deal with 'Argument list too long' for a R CMD check?

2008-12-09 Thread Whit Armstrong
]> wrote: > Never used, but I seem to recall that this was good for that: > > http://en.wikipedia.org/wiki/Xargs > > Jeff > > On Tue, Dec 9, 2008 at 3:13 PM, Whit Armstrong <[EMAIL PROTECTED]> wrote: >> Since, gcc was using upwards of 2gb of ram to compile my pac

[Rd] any suggestions to deal with 'Argument list too long' for a R CMD check?

2008-12-09 Thread Whit Armstrong
Since, gcc was using upwards of 2gb of ram to compile my package, I just split all the functions into individual files. I guess I'm too clever for myself, because now I get hit with the "Argument list too long" error. Is there a way to deal with this aside from writing my own configure script (wh

Re: [Rd] parallel build for package? (equivalent of make -j8)

2008-12-01 Thread Whit Armstrong
yes, this was just a parallel build within one package. Thanks very much for your help. -Whit On Mon, Dec 1, 2008 at 6:01 AM, Uwe Ligges <[EMAIL PROTECTED]> wrote: > > > Prof Brian Ripley wrote: >> >> On Mon, 1 Dec 2008, Uwe Ligges wrote: >> >>> &g

Re: [Rd] parallel build for package? (equivalent of make -j8)

2008-11-30 Thread Whit Armstrong
linux, x86-64. omg, MAKE="make -j8" R CMD INSTALL works beautifully. Thanks for making me see the light. Cheers, Whit On Sun, Nov 30, 2008 at 12:29 PM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Whit Armstrong wrote: >> >> I have a package that takes about 20

[Rd] parallel build for package? (equivalent of make -j8)

2008-11-30 Thread Whit Armstrong
I have a package that takes about 20 minutes to compile which tends to prolong the compile/test/compile cycle. Does anyone know how to get R CMD check or R CMD INSTALL to use parallel make? I looked at R CMD INSTALL --help, but I don't see anything obvious arguments to do this. Thanks, Whit ___

[Rd] anyone familiar with this error?

2008-11-18 Thread Whit Armstrong
[EMAIL PROTECTED] R.packages]$ sudo R CMD INSTALL portfolio.construction * Installing to library '/usr/local/lib64/R/library' * Installing *source* package 'portfolio.construction' ... ** R ** preparing package for lazy loading Loading required package: fts Loading required package: quadprog Loadi

Re: [Rd] Fwd: Fwd: SWIG with R and C++ STL

2008-11-18 Thread Whit Armstrong
no all compilers support the export keyword. just put the template in a .h or .hpp file and include it in your .cpp file. that should be enough. -Whit On Tue, Nov 18, 2008 at 2:50 PM, charlie <[EMAIL PROTECTED]> wrote: > Thanks guys for all your kind heartedness. > > Yeah, I got messed up with

Re: [Rd] Fwd: SWIG with R and C++ STL

2008-11-06 Thread Whit Armstrong
did you wrap your function prototype in extern "C" ? -Whit On Thu, Nov 6, 2008 at 1:16 PM, charlie <[EMAIL PROTECTED]> wrote: > Hi, all > > I didn't get any response from swig for my question. > see if I can get some help here > > Thanks > > -- Forwarded message -- > From: charli

Re: [Rd] R 2.8.0 qqnorm produces error with object of class zoo?

2008-11-03 Thread Whit Armstrong
sorry, for joining this thread so late. I've just upgraded to R2.8.0 and was hit with the same issue immediately in my fts package. Has any consensus been reached about how to deal with this issue? Do I understand correctly that the change to use: [sort.c: 592] PROTECT(call = lang4(install(".gt"

[Rd] possible bug in model.matrix

2005-09-13 Thread Whit Armstrong
Is this a bug, or have I misunderstood the proper use of lm? Thanks, Whit code: x <- rnorm(50) y <- matrix(as.logical(round(runif(100),0)),ncol=2) NROW(x)==NROW(y) lm(x~y) > x <- rnorm(50) > y <- matrix(as.logical(round(runif(100),0)),ncol=2) > NROW(x)==NROW(y) [1] TRUE > lm(x~y) Error in "[[