Re: [Rd] Why is the diag function so slow (for extraction)?

2015-05-04 Thread peter dalgaard
> On 04 May 2015, at 19:59 , franknarf wrote: > > But I'm still wondering why diag() uses c()...? With it being so slow, I'd > be inclined to write a qdiag() without the c() and just use that the next > time I need matrix algebra. Any insight would be appreciated; thanks! Well, there are two po

Re: [Rd] Matlab Program to R

2015-05-04 Thread franknarf
R rounds. Perhaps Matlab avoids doing so here. It's hard to say because your code is too long for anyone to read through. Maybe you could post a smaller reproducible example to pinpoint the result you see here. If you can do that, I think you may also find that the R-help mailing list is a better

[Rd] Shouldn't vector indexing with negative out-of-range index give an error?

2015-05-04 Thread Henrik Bengtsson
In Section 'Indexing by vectors' of 'R Language Definition' (http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Indexing-by-vectors) it says: "Integer. All elements of i must have the same sign. If they are positive, the elements of x with those index numbers are selected. If i contains n

[Rd] Why is the diag function so slow (for extraction)?

2015-05-04 Thread franknarf
(I asked this question on StackOverflow a short time ago; sorry if you're seeing it again. Feel free to answer there as well if you like. The code formatting and such on that site can be nice.) I benchmarked matrix and vector subsetting to extract t

Re: [Rd] Define replacement functions

2015-05-04 Thread Hadley Wickham
On Mon, May 4, 2015 at 12:06 PM, wrote: > No. I fixed that, the NAMESPACE file now contains: > > S3method("[[<-", mylist) > S3method("$<-", mylist) > > It still does not work. I also created a print method (print.mylist) which > did work out of the box, regardless of being in the NAMESPACE file

Re: [Rd] Print output during long tests?

2015-05-04 Thread Paul Gilbert
If your tests can be divided into multiple files in the tests/ directory then you will get lines like * checking tests ... Running ‘test1.R’ Running ‘test2.R’ Running ‘test3.R’ ... Paul On 05/04/2015 11:52 AM, Toby Hocking wrote: I am the author of R package animint which uses testthat f

Re: [Rd] Define replacement functions

2015-05-04 Thread soeren . vogel
No. I fixed that, the NAMESPACE file now contains: S3method("[[<-", mylist) S3method("$<-", mylist) It still does not work. I also created a print method (print.mylist) which did work out of the box, regardless of being in the NAMESPACE file or not. Could it be somehow in here (also in my NAMES

Re: [Rd] Print output during long tests?

2015-05-04 Thread peter dalgaard
I really can't see it as a job for R to circumvent hare-brained sysadmin schemes like this You're not telling us who or what Travis is. I expect travis-ci.org has some clues, but in general, people on this list won't know. If it doesn't support setting parameters for the timeout, and it is

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-04 Thread Laurent Gautier
On May 4, 2015 12:06 AM, "Simon Urbanek" wrote: > > Laurent, > > On May 3, 2015, at 8:07 PM, Laurent Gautier wrote: > > > rPython appears to provide an interface from R to Python by embedding > > Python and I'd think that it can safely assume that R has been initialized, > > but might not be the

Re: [Rd] Print output during long tests?

2015-05-04 Thread Thierry Onkelinx
Dear Toby, Have you tried adding output to the tests with the context() function? Best regards, Thierry Op 4 mei 2015 18:28 schreef "Toby Hocking" : I am the author of R package animint which uses testthat for unit tests. This means that there is a single test file (animint/tests/testthat.R) a

[Rd] Print output during long tests?

2015-05-04 Thread Toby Hocking
I am the author of R package animint which uses testthat for unit tests. This means that there is a single test file (animint/tests/testthat.R) and during R CMD check we will see the following output * checking tests ... Running ‘testthat.R’ I run these tests on Travis, which has a policy that i

[Rd] Problem with adding slots to S4 object

2015-05-04 Thread Thierry Onkelinx
Dear all, I'm trying to create a virtual S4 class with some subclasses. I noticed that adding slots to this class increases the memory use and slows the functions down. Note that I'm adding very small slots (integer or character both of length 1). I've made a reproducible example at https://githu

Re: [Rd] Define replacement functions

2015-05-04 Thread Hadley Wickham
Did you export the S3 methods in the NAMESPACE? Hadley On Mon, May 4, 2015 at 7:52 AM, wrote: > Hello > > I tried to define replacement functions for the class "mylist". When I test > them in an active R session, they work -- however, when I put them into a > package, they don't. Why and how

[Rd] Define replacement functions

2015-05-04 Thread soeren . vogel
Hello I tried to define replacement functions for the class "mylist". When I test them in an active R session, they work -- however, when I put them into a package, they don't. Why and how to fix? make_my_list <- function( x, y ) { return(structure(list(x, y, class="mylist"))) } mylist