Re: [Rd] RFC: (in-principle) native unquoting for standard evaluation

2017-03-18 Thread Michael Lawrence
s some built in support. > > Hadley > > > On Friday, March 17, 2017, Michael Lawrence > wrote: >> >> Interesting idea. Lazy and non-standard evaluation is going to happen; the >> language needs a way to contain it. >> >> I'll extend the proposal so t

Re: [Rd] `[` not recognized as a primitive in certain cases.

2017-03-28 Thread Michael Lawrence
There is a difference between the symbol and the function (primitive or closure) to which it is bound. This: mc2 <- as.call(list(`[`,iris,2,"Species")) Evaluates `[` to its value, in this case the primitive object, and the primitive itself is incorporated into the returned call. If you were to d

Re: [Rd] Crash after (wrongly) applying product operator on S4 object that derives from list

2017-04-19 Thread Michael Lawrence
I think this is a known issue with Java messing with the stack, see e.g. http://r.789695.n4.nabble.com/Error-memory-exhausted-limit-reached-td4729708.html. I'll fix the infinite recursion caused by the methods package. Michael On Wed, Apr 19, 2017 at 1:12 AM, Wolfgang Huber wrote: > Dear Hilma

Re: [Rd] Problems with S4 methods dispatching on `...` (aka dotsMethods)

2017-04-20 Thread Michael Lawrence
Thanks for pointing out these issues. I have a fix that I will commit soon. Btw, I would never have seen the post on Stack Overflow. It's best to report bugs on the bugzilla. Michael On Thu, Apr 20, 2017 at 8:30 AM, Andrzej Oleś wrote: > Hi all, > > I recently encountered some unexpected behavi

Re: [Rd] Problems with S4 methods dispatching on `...` (aka dotsMethods)

2017-04-25 Thread Michael Lawrence
in print(a) : object 'b' not found > > > Any chances of fixing this? > > Cheers, > Andrzej > > > > On Fri, Apr 21, 2017 at 11:40 AM, Andrzej Oleś > wrote: >> >> Great, thanks Michael for you quick response! >> >> I started off with a

Re: [Rd] `match.call` and dots substitution

2017-04-30 Thread Michael Lawrence
The result of match.call() should be something that would evaluate correctly in the frame of the fun0() call. While wrapping things in parentheses is unlikely to cause any problems, arbitrary calls and symbols would. Consider the following: fun0 <- function(a, ...) { x <- 2L fun1(...) } f

Re: [Rd] surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)

2017-06-06 Thread Michael Lawrence
Thanks for the report. The issue is that one cannot set special attributes like names, dim, dimnames, etc on S4 objects. I was aready working on this and will have a fix soon. > a2 <- new("A2") > dim(a2) <- c(2, 3) Error in dim(a2) <- c(2, 3) : invalid first argument On Mon, Jun 5, 2017 at 6:08

Re: [Rd] surprisingly, S4 classes with a "dim" or "dimnames" slot are final (in the Java sense)

2017-06-06 Thread Michael Lawrence
I've fixed this and will commit soon. Disregard my dim<-() example; that behaves as expected (the class needs a dim<-() method). Michael On Tue, Jun 6, 2017 at 5:16 AM, Michael Lawrence wrote: > Thanks for the report. The issue is that one cannot set special attributes >

Re: [Rd] paste strings in C

2017-06-27 Thread Michael Lawrence
To do this in C, it would probably be easier and faster to just do the string manipulation directly. Luckily, there are already packages that have done this for you. See an example below using the S4Vectors package. foo2 <- function(mymat, colnms, tilde=FALSE) { chars <- colnms[col(mymat)]

Re: [Rd] Problems with S4 methods dispatching on `...` (aka dotsMethods)

2017-07-28 Thread Michael Lawrence
gt; wrote: >> >> You're right, I must have mixed up my R versions when running the example, >> as the problem seems to be resolved in R-devel. >> >> Sorry for the noise and thanks again for fixing this. >> >> Andrzej >> >> On Tue, Apr 25,

Re: [Rd] Problems with S4 methods dispatching on `...` (aka dotsMethods)

2017-08-07 Thread Michael Lawrence
; setGeneric("f", signature = "...") > > # unexpectedly fails to find 'b' > f() > ## Error in print(a) : object 'b' not found > > > On Fri, Jul 28, 2017 at 9:15 PM, Michael Lawrence < > lawrence.mich...@gene.com> wro

Re: [Rd] S4 method implementation for S3 class

2017-09-22 Thread Michael Lawrence
The %*% function is a primitive. As it says in the documentation under ?Methods_Details Methods may be defined for most primitives, and corresponding metadata objects will be created to store them. Calls to the primitive still go directly to the C code, which will sometimes che

Re: [Rd] S4 method implementation for S3 class

2017-09-22 Thread Michael Lawrence
On Fri, Sep 22, 2017 at 10:28 AM, Iñaki Úcar wrote: > 2017-09-22 19:04 GMT+02:00 Michael Lawrence : >> The %*% function is a primitive. As it says in the documentation under >> ?Methods_Details >> >> Methods may be defined for most primitives, and corresponding &g

Re: [Rd] advise on Depends

2013-10-25 Thread Michael Lawrence
On Wed, Oct 23, 2013 at 8:33 PM, Kasper Daniel Hansen < kasperdanielhan...@gmail.com> wrote: > This is about the new note > > Depends: includes the non-default packages: > ‘BiocGenerics’ ‘Biobase’ ‘lattice’ ‘reshape’ ‘GenomicRanges’ > ‘Biostrings’ ‘bumphunter’ > Adding so many packages to the

[Rd] getting environment from "top" promise

2014-02-11 Thread Michael Lawrence
Hi all, It seems that there is a use case for obtaining the environment for the "top" promise. By "top", I mean following the promise chain up the call stack until hitting a non-promise. S4 data containers often mimic the API of base R data structures. This means writing S4 methods for functions

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Michael Lawrence
The BiocGenerics package was designed to solve this issue within Bioconductor. It wouldn't be the worst thing in the world to depend on the simple BiocGenerics package for now, but ideally the base generics would be defined higher up, perhaps in the methods package itself. Maybe someone else has a

Re: [Rd] Conflicting definitions for function redefined as S4 generics

2014-03-26 Thread Michael Lawrence
ough it > wouldn't help (as it shouldn't) if the two generics didn't agree on > signature or both carried methods for the same class signature. > > ~G > > > On Wed, Mar 26, 2014 at 4:38 AM, Michael Lawrence < > lawrence.mich...@gene.com> wrote: > >&

Re: [Rd] [Bioc-devel] Conflicting definitions for function redefined as S4 generics

2014-04-03 Thread Michael Lawrence
On Thu, Apr 3, 2014 at 4:33 AM, Ulrich Bodenhofer wrote: > On 03/27/2014 06:31 PM, Hervé Pagès wrote: > >> On 03/27/2014 02:13 AM, Ulrich Bodenhofer wrote: >> >>> [...] >>> >>> >>> For the time being, it seems I have three options: >>> >>> 1) not supplying the sort() function yet (it is not yet in

Re: [Rd] duplication regression (?)

2014-04-15 Thread Michael Lawrence
This went off-list, but a patch has been submitted to fix the issue. On Mon, Apr 14, 2014 at 4:12 AM, Scott Kostyshak wrote: > Below is an example of output that changed as a result of r64970. I > did not see any NEWS item suggesting this change is expected. > > Note that the example is contrive

Re: [Rd] memory allocation if multiple names point to the same object

2014-06-03 Thread Michael Lawrence
This is because R keeps track of the names of an object, until there are 2 names. Thus, once it reaches 2, it can no longer decrement the named count. In this example, 'a' reaches 2 names ('a' and 'b'), thus R does not know that 'a' only has one name at the end. Luke has added reference counting t

Re: [Rd] R CMD check warning with S3 method

2014-06-29 Thread Michael Lawrence
While the change to the symbol lookup is generally useful (e.g., for finding S4 methods that become available whenever a package is loaded), it seems that we ultimately want a mechanism by which a package namespace can formally declare that it is re-exporting a symbol from some package. Then, for e

Re: [Rd] R CMD check warning with S3 method

2014-06-30 Thread Michael Lawrence
06/2014, 3:07 PM, Michael Lawrence wrote: > > While the change to the symbol lookup is generally useful (e.g., for > > finding S4 methods that become available whenever a package is loaded), > > it seems that we ultimately want a mechanism by which a package > > namespace can fo

Re: [Rd] R CMD check warning with S3 method

2014-07-01 Thread Michael Lawrence
On Mon, Jun 30, 2014 at 6:19 AM, Duncan Murdoch wrote: > On 30/06/2014 8:51 AM, Michael Lawrence wrote: > >> I think it's generally nice to be able to compute on the network of >> imported and exported symbols, and exportFrom() preserves the information >> that a s

Re: [Rd] Depot for S3 to S4 generics (as in stats4)?

2014-07-09 Thread Michael Lawrence
You might be interested in the BiocGenerics package from Bioconductor. It defines a bunch of "base" generics, as well as some that are specific to Bioc needs. Being Bioc-oriented, it's not really meant to be a base4, but it comes reasonably close, and it could serve as a jumping off point for a bas

Re: [Rd] how to list external dependencies (i.e., non-R packages)?

2014-07-14 Thread Michael Lawrence
One idea is to wrap system libraries in R packages. This is what Martin did for zlib with zlibbioc. That's feasible for a tiny library like zlib; for other things this approach would not be feasible. For imlib2 and imagemagick, it might be. Someone has to maintain it, and there would need to be car

Re: [Rd] portableParalleSeeds Package violation, CRAN exception?

2014-08-07 Thread Michael Lawrence
I would recommend against maintaining multiple global variables and would instead take an object-oriented approach. Probably should define a reference class representing a random number stream (think java.util.Random). Then define a reference class representing a collection of them, tracking which

Re: [Rd] organisation of packages & CRAN

2014-11-09 Thread Michael Lawrence
On Sun, Nov 9, 2014 at 8:24 AM, Steven Sagaert wrote: > Hi, > I’ve been using R on and off for a couple of years. I think R is pretty > great but one thing I’d like to see improved is the way packages are > organised. Instead of CRAN being a long list of packages having a short & > usually uninte

Re: [Rd] Feature request: mixing `...` (three dots) with other formal arguments in S4 methods

2014-12-01 Thread Michael Lawrence
On Thu, Nov 27, 2014 at 6:53 PM, Janko Thyson wrote: > Well, the benefit lies in the ability to pass along arguments via `...` to > more than one recipient that use *identical argument names* and/or when > these recipients are not necessarily located on the same calling stack > layer. > > I'm *no

Re: [Rd] RFC: getifexists() {was [Bug 16065] "exists" ...}

2015-01-08 Thread Michael Lawrence
If we do add an argument to get(), then it should be named consistently with the ifnotfound argument of mget(). As mentioned, the possibility of a NULL value is problematic. One solution is a sentinel value that indicates an unbound value (like R_UnboundValue). But another idea (and one pretty sim

Re: [Rd] RFC: getifexists() {was [Bug 16065] "exists" ...}

2015-01-08 Thread Michael Lawrence
On Thu, Jan 8, 2015 at 11:57 AM, wrote: > On Thu, 8 Jan 2015, Michael Lawrence wrote: > > If we do add an argument to get(), then it should be named consistently >> with the ifnotfound argument of mget(). As mentioned, the possibility of a >> NULL value is problemat

Re: [Rd] setequal: better readability, reduced memory footprint, and minor speedup

2015-01-08 Thread Michael Lawrence
Currently unique() does duplicated() internally and then extracts. One could make a countUnique that simply counts, rather than allocate the logical return value of duplicated(). But so much of the cost is in the hash operation that it probably won't help much, but that might depend on the sizes of

[Rd] default min-v/nsize parameters

2015-01-15 Thread Michael Lawrence
Just wanted to start a discussion on whether R could ship with more appropriate GC parameters. Right now, loading the recommended package Matrix leads to: > library(Matrix) > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 1076796 57.61368491 73.1 1198505 64.1 Vcells 1671329 12.

Re: [Rd] reducing redundant work in methods package

2015-01-21 Thread Michael Lawrence
Note that setMethod() resolves .BasicFunsList in the methods namespace directly when setting a method on a primitive. Somehow there should be consistency between genericForPrimitive() and the check in setMethod(). Also, we can probably step away from the use of elNamed(), given that [[ now uses ex

Re: [Rd] reducing redundant work in methods package

2015-01-22 Thread Michael Lawrence
) > > stop(gettextf("methods may not be defined for primitive function %s > in this version of R", > > sQuote(f)), > > domain = NA) > > ans > > } > > Seems to work just fine. > > Yes, "el"

Re: [Rd] reducing redundant work in methods package

2015-01-22 Thread Michael Lawrence
Actually, after reading the comment about it being OK for it being NULL, it's not a bug after all. On Thu, Jan 22, 2015 at 5:57 AM, Michael Lawrence wrote: > I also just noticed that there is a bug: identical(ans, FALSE) should > be is.null(ans). > > So no error is t

Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread Michael Lawrence
On Thu, Jan 22, 2015 at 11:44 AM, wrote: > > For default methods there ought to be a way to create those so the > default method is computed at creation or load time and stored in an > environment. We had considered that, but we thought the definition of the function would be easier to interpret

Re: [Rd] :: and ::: as .Primitives?

2015-01-23 Thread Michael Lawrence
On Fri, Jan 23, 2015 at 10:11 AM, Hervé Pagès wrote: > Hi, > > On 01/23/2015 07:01 AM, luke-tier...@uiowa.edu wrote: >> >> On Thu, 22 Jan 2015, Michael Lawrence wrote: >> >>> On Thu, Jan 22, 2015 at 11:44 AM, wrote: >>>> >>>> >>

Re: [Rd] Proper way to define cbind, rbind for s4 classes in package

2015-01-24 Thread Michael Lawrence
On Sat, Jan 24, 2015 at 12:58 AM, Mario Annau wrote: > Hi all, > this question has already been posted on stackoverflow, however without > success, see also > http://stackoverflow.com/questions/27886535/proper-way-to-use-cbind-rbind-with-s4-classes-in-package. > > I have written a package using S4

Re: [Rd] speedbump in library

2015-01-26 Thread Michael Lawrence
A isNamespaceLoaded() function would be a useful thing to have in general if we are interested in readable code. An efficient implementation would be just a bonus. On Mon, Jan 26, 2015 at 3:36 AM, Martin Maechler wrote: >> Winston Chang >> on Fri, 23 Jan 2015 10:15:53 -0600 writes:

Re: [Rd] speedbump in library

2015-01-26 Thread Michael Lawrence
isLoadedNamespace() sounds fine to me.. Thanks for addressing this, Michael On Mon, Jan 26, 2015 at 5:51 AM, Martin Maechler < maech...@lynne.stat.math.ethz.ch> wrote: > >>>>> Michael Lawrence > >>>>> on Mon, 26 Jan 2015 05:12:55 -0800 writes: >

Re: [Rd] names function for environments?

2015-01-27 Thread Michael Lawrence
I think ls(, sort=FALSE) would be more explicit and thus clearer. There is much precedent for having arguments that request less work to be done e.g. unlist(use.names=FALSE). Yes, the extra typing is a bit painful, but there is no intuitive reason why names() would be unsorted, while ls() would be

Re: [Rd] names function for environments?

2015-01-27 Thread Michael Lawrence
Pete > > ________ > Peter M. Haverty, Ph.D. > Genentech, Inc. > phave...@gene.com > > > On Tue, Jan 27, 2015 at 7:26 AM, Michael Lawrence > wrote: > > I think ls(, sort=FALSE) would be more explicit and thus clearer. There > is > > much preced

Re: [Rd] [Q] Get formal arguments of my implemented S4 method

2015-01-28 Thread Michael Lawrence
Would you please clarify your exact use case? Thanks, Michael On Wed, Jan 28, 2015 at 9:02 AM, Roebuck,Paul L wrote: > Interrogating some (of my own) code in another package. > > >norm.meth <- getMethod("normalize", "MatrixLike") > >message("str(norm.meth)") > >str(norm.meth) > > >message("show

Re: [Rd] [Q] Get formal arguments of my implemented S4 method

2015-01-28 Thread Michael Lawrence
;vs", "tukey"), > "calc.medians": TRUE, > "sweep.cols": calc.medians, > "recalc.after.sweep": sweep.cols, > "Š" > } > > not those of the generic: > > { > "object", > "

Re: [Rd] names function for environments?

2015-01-29 Thread Michael Lawrence
On Thu, Jan 29, 2015 at 5:51 AM, Martin Maechler < maech...@lynne.stat.math.ethz.ch> wrote: > >>>>> Michael Lawrence > >>>>> on Tue, 27 Jan 2015 07:59:59 -0800 writes: > > > Since the contract of ls() is to sort, there is nothing wrong

Re: [Rd] [Q] Get formal arguments of my implemented S4 method

2015-01-29 Thread Michael Lawrence
On Thu, Jan 29, 2015 at 5:57 AM, John Chambers wrote: > > On Jan 28, 2015, at 6:37 PM, Michael Lawrence > wrote: > > At this point I would just due: > > formals(body(method)[[2L]]) > > At some point we need to figure out what to do with this .local() > confusion.

Re: [Rd] [Q] Get formal arguments of my implemented S4 method

2015-01-29 Thread Michael Lawrence
("x > 3: .QQQ.integer(x, ...) at #5 > > 2: QQQ(3L, 10) > > 1: QQQ(3L, 10) > > I think the latter gives the user more guidance on how to fix the > problem. > > > > Perhaps instead of searching for an assignment to '.local' you could > >

Re: [Rd] Proper way to define cbind, rbind for s4 classes in package

2015-02-01 Thread Michael Lawrence
ispatch to cbind.data.frame if one of the args is a data.frame). There may no longer be a need for cBind() and rBind(). Michael On Mon, Jan 26, 2015 at 3:55 AM, Martin Maechler < maech...@lynne.stat.math.ethz.ch> wrote: > >>>>> Michael Lawrence > >>>>> on

Re: [Rd] Proper way to define cbind, rbind for s4 classes in package

2015-02-09 Thread Michael Lawrence
gt; for my test cases? > best, > mario > > > Am 02/02/15 um 12:32 schrieb Martin Maechler: > >>>>>> Michael Lawrence > >>>>>> on Sun, 1 Feb 2015 19:23:06 -0800 writes: > > > > > I've implemented the proposed changes in >

Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Michael Lawrence
Presumably one could stream over the data twice, the first to get the size, without storing the data. Slower but more memory efficient, unless I'm missing something. Michael On Tue, Mar 17, 2015 at 2:03 PM, Simon Urbanek wrote: > Jorge, > > what you propose is not possible because the size of t

Re: [Rd] evaluation in transform versus within

2015-04-01 Thread Michael Lawrence
There is no important difference between transform() and within(). They have the same pitfalls. If your general code is unable to guarantee the scope of the symbol resolution, the behavior of the code is unlikely to be very predictable. I've explored some solutions in the S4Vectors package, see th

Re: [Rd] Add first() and last() to utils?

2015-05-01 Thread Michael Lawrence
I would argue that it should be: first <- function(x, ...) head(x, n=1L, ...) So it's simpler and we don't have people using first() and head() interchangeably for non-default 'n'. first() should mean "the" first. That also avoids forcing 'n' to be in the formals of every generic+method. Of cours

Re: [Rd] Problem with adding slots to S4 object

2015-05-05 Thread Michael Lawrence
There are too many arguments in the signature of the my_inla generic. The signature defaults to every argument in the formals, which are probably already over-specified. Typically, one defines a generic with the formals (x, ...), or perhaps in this case (x, model, ...), but more on that below Unre

Re: [Rd] Defining Constant variable in a package

2015-05-15 Thread Michael Lawrence
I'm guessing you just need to define them in /R/constants.R and then export() them from the NAMESPACE. On Fri, May 15, 2015 at 2:32 AM, Christophe Genolini wrote: > Hi all, > > In my package, I define some constant. In the previous version of R, I > just define then in "/data/constants.R" but it

[Rd] url() does not decode when writing local files

2011-11-10 Thread Michael Lawrence
The url() function does not seem to decode a URL, at least when creating local files. For example, if "%20" is used instead of " ", the "%20" will be included verbatim in the file name. In my opinion, it should perform the replacement, i.e., the equivalent of URLdecode(). And really, it should thr

Re: [Rd] S4 NAMESPACE method imports and exports do not include (promoted?) generics

2011-12-17 Thread Michael Lawrence
I guess what it boils down to is whether it makes sense for PkgB to have exportMethods(unique) when PkgB does not export(unique) or have PkgA in Depends. And whether it makes sense for PkgC to have importMethodsFrom(PkgB, unique) without importFrom(PkgA, unique). If it is not feasible/sensible to

[Rd] issue with base:::namespaceImportMethods

2012-04-05 Thread Michael Lawrence
Hi, I've noticed an issue with S4 methods and namespaces which only arises in particular, difficult to reproduce configurations. One example is the ggbio package in Bioconductor, which currently emits these warnings when its namespace is loaded: -- library(ggbio) Loading requ

Re: [Rd] On RObjectTables

2012-07-19 Thread Michael Lawrence
You might be able to take advantage of the ObjectTable support in C, which is part of R, see R_ext/Callbacks.h. Michael On Thu, Jul 19, 2012 at 10:30 AM, Jeroen Ooms wrote: > I was wondering if anyone knows more about the state of RObjectTables. This > largely undocumented functionality was intr

[Rd] callGeneric(...) and lazy evaluation

2012-07-22 Thread Michael Lawrence
There seems to be an issue with passing "..." to callGeneric(), because it assumes that the call can be evaluated in the parent frame. Due to lazy evaluation, that is often not going to work for arguments that are simply passed down via "...". Here is an example: setClass("A", contains = "charact

Re: [Rd] On RObjectTables

2012-07-23 Thread Michael Lawrence
Luke, Please keep me advised on this, because the Qt interfaces heavily rely on the ObjectTables (btw, it has worked great for my use cases). Michael On Fri, Jul 20, 2012 at 7:32 AM, wrote: > I believe everyone who has worked on the relevant files has tried to > maintain this functionality, bu

[Rd] setting invalid fields on reference classes sometimes allowed

2012-08-05 Thread Michael Lawrence
I've found that reference class objects tend to behave like plain old environments wrt field access, unless a method on e.g. $<- is explicitly defined. Here is a code snippet: library(methods) Foo <- setRefClass("Foo") foo <- Foo$new() foo$a <- 2 # why does this succeed? not a valid field! ## se

[Rd] callNextMethod and "..." issue

2012-08-21 Thread Michael Lawrence
It seems that there is an issue when calling callNextMethod() inside a method without "..." in its formals but defined on a generic WITH "..." in its formals. Whenever that method is called with an argument that is not explicitly named in the generic formals, we get the following error: setClass("

Re: [Rd] "Default" accessor in S4 classes

2013-01-07 Thread Michael Lawrence
On Mon, Jan 7, 2013 at 3:23 PM, Chris Jewell wrote: > Hi All, > > I'm currently trying to write an S4 class that mimics a data.frame, but > stores data on disc in HDF5 format. The idea is that the dataset is likely > to be too large to fit into a standard desktop machine, and by using > subscript

[Rd] stack imbalance in max.col for non-real matrices

2013-04-17 Thread Michael Lawrence
It's tough to reliably reproduce, but I often get stack imbalance warnings when calling max.col() on non-real/double matrix. The code is conditionally PROTECTing but not incrementing its nprot counter for the eventual UNPROTECT. Pretty sure this would fix (but I haven't tested it): Index: array.c

Re: [Rd] combine UserDefinedDatabase and regular environments

2009-11-19 Thread Michael Lawrence
On Thu, Nov 5, 2009 at 9:58 AM, Romain Francois wrote: > Hello, > > Is it possible to have the effect of UserDefinedDatabase outside of > "attached" environments ? Can I disguise an environment of the sys.frames() > as a UserDefinedDatabase ? > > This seems to suggest that it might be possible : >

Re: [Rd] combine UserDefinedDatabase and regular environments

2009-12-02 Thread Michael Lawrence
On Thu, Nov 19, 2009 at 10:54 AM, Romain Francois < romain.franc...@dbmail.com> wrote: > On 11/19/2009 06:14 PM, Michael Lawrence wrote: > >> >> >> On Thu, Nov 5, 2009 at 9:58 AM, Romain Francois >> mailto:romain.franc...@dbmail.com>> wrote: >>

Re: [Rd] combine UserDefinedDatabase and regular environments

2009-12-04 Thread Michael Lawrence
On Wed, Dec 2, 2009 at 11:11 PM, Romain Francois wrote: > On 12/03/2009 12:17 AM, Michael Lawrence wrote: > >> >> >> On Thu, Nov 19, 2009 at 10:54 AM, Romain Francois >> mailto:romain.franc...@dbmail.com>> wrote: >> >>On 11/19/2009 06:14 PM, M

Re: [Rd] S4 dispatch and S3 "connection" objects

2009-12-15 Thread Michael Lawrence
On Mon, Dec 14, 2009 at 11:36 PM, Romain Francois < romain.franc...@dbmail.com> wrote: > Hello, > > I'm trying to get S4 dispatch on S3 "connection" objects. > > So I do : > > setOldClass( "connection" ) > > and then : > > setGeneric( "bling", function(object) standardGeneric( "bling" ) ) > setMet

Re: [Rd] Microsoft conspiracy against R?

2010-04-05 Thread Michael Lawrence
The cairoDevice package supports getGraphicsEvent(), and seems to work on all platforms now. Michael On Mon, Apr 5, 2010 at 5:24 AM, Christophe Genolini wrote: > Hi the list, > I am using getGraphicsEvent (pakage kml, function 'choice') to build a user > friendly interface, but it seems that it

[Rd] support for radix order() over entire range of integers

2010-06-11 Thread Michael Lawrence
Hi, Is there any good reason not to allow radix sorting via order() over the entire range of R (32bit) integers, instead of setting a hard limit at 100,000? Many machines have plenty of memory to support this. Seems like it is just a matter of dynamic allocating the bucket array instead of the cur

[Rd] patch: allow R CMD build exclude patterns to match symlinks

2007-10-02 Thread Michael Lawrence
The following is a patch (svn diff) for the R CMD build script that calculates exclude patterns after the tar/untar step rather than before. The perl find() function, used in the calculation of the exclude patterns, ignores symlinks, which meant that directory symlinks were not considered for exclu

Re: [Rd] Using SJava? (was R-devel Digest, Vol 56, Issue 27)

2007-10-29 Thread Michael Lawrence
On 10/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > The error is: > > > Exception in thread "main" java.lang.UnsatisfiedLinkError: no SJava in > > java.library.path It sounds like you need to put the directory containing the dll's included with the SJava package on your java.library.pat

Re: [Rd] RGtk2 + tcltk combination problem (PR#10497)

2007-12-06 Thread Michael Lawrence
This is likely a result of RGtk2 "piggybacking" on the tcl/tk event loop on Windows. One workaround in your situation is run gtkMain() at the R console to force the GTK+ event loop to run. The downside is that the R console will no longer be responsive. It's tough to keep so many interfaces workin

Re: [Rd] help with R rendering engine

2008-02-09 Thread Michael Lawrence
On Feb 7, 2008 4:49 PM, Mark W Kimpel <[EMAIL PROTECTED]> wrote: > I'm doing some work on a potential patch to the Bioconductor package > Rgraphviz and have some questions on code that is contained in engine.c. > In particular, I am developing some custom shapes using polygon and need > to make su

Re: [Rd] RGtk2 : Using GtkImage with GIF (PR#10757)

2008-02-15 Thread Michael Lawrence
Hi, This is likely an issue with the event loop. If you move your mouse around, does the image update? Does it animate if you run gtkMain() in the console? Thanks, Michael On Thu, Feb 14, 2008 at 4:20 AM, <[EMAIL PROTECTED]> wrote: > Full_Name: Hans Dieter > Version: 2.6.1 > OS: Windows > Submi

Re: [Rd] .net and R

2008-02-24 Thread Michael Lawrence
On Sat, Feb 23, 2008 at 3:18 AM, Yuan Jian <[EMAIL PROTECTED]> wrote: > Hi, > is it possible to call R functions from visual studio .net such as c#? > > There is at least one existing C# program accessing R: http://ncrr.pnl.gov/software/dante.stm They do it using the R(D)COM server, which is un

Re: [Rd] New version of X11, png and jpeg

2008-02-25 Thread Michael Lawrence
On Mon, Feb 25, 2008 at 10:56 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > R-devel has new versions of the X11(), png() and jpeg() devices on > Unix-alikes. The intention is that these are used identically to the > previous versions (which remain available) but will produce higher-quality >

Re: [Rd] New version of X11, png and jpeg

2008-02-26 Thread Michael Lawrence
t of those will be ironed out as more win32 programs rely on Cairo (e.g. Firefox 3.0). > > Brian > > > On Mon, 25 Feb 2008, Michael Lawrence wrote: > > > On Mon, Feb 25, 2008 at 10:56 AM, Prof Brian Ripley < > [EMAIL PROTECTED]> > > wrote: > > > >&g

Re: [Rd] New version of X11, png and jpeg

2008-02-26 Thread Michael Lawrence
On Tue, Feb 26, 2008 at 8:18 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > Revision r44621 supports (in a limited way) cairo 1.0 and hence I believe > vanilla FC5 -- I found what purports to be a vanilla FC5 box and it works > quite well there. > > Two people have reported that the svg(), cai

[Rd] revision 44805 breaks promptMethods()

2008-03-24 Thread Michael Lawrence
Hi, It seems that promptMethods() was changed in revision 44805 to include a call to "isGenericFunction" that at least as of revision 44861 does not exist as far as I can tell. This results in: could not find function "isGenericFunction" when evaluating e.g. promptMethods("myGeneric") Thanks, M

Re: [Rd] Odd tcltk and Rattle interference on MS/Windows

2008-04-05 Thread Michael Lawrence
Hi Graham, Your guess is right. The event loop stuff is handled differently on Windows than on Unix-like OSes. There is a hook, called tcl_do that is hard-coded into the R Windows GUI. It is called whenever the console is idle. RGtk2 is able to hook into that to process GTK+ events. The problem is

Re: [Rd] swig 1.3.35 & R - is the R wrapper still maintained and of interest?

2008-04-18 Thread Michael Lawrence
I am not sure what is included with swig, but have you seen this? http://www.omegahat.org/RSWIG/ I'm not sure if it's actively maintained, but at the very least it might help in your efforts at getting an R swig driver working. Michael On Fri, Apr 18, 2008 at 3:49 AM, Soeren Sonnenburg <[EMAIL

Re: [Rd] Pb with package::foo(x) <- value

2008-04-18 Thread Michael Lawrence
On Fri, Apr 18, 2008 at 7:17 PM, Herve Pages <[EMAIL PROTECTED]> wrote: > Hi, > > The parser doesn't seem to like this: > > somePackage::foo(x) <- value > somePackage:::foo(x) <- value > > where foo() is a replacement function or method defined in package > somePackage. > > For example: > >

Re: [Rd] swig 1.3.35 & R - is the R wrapper still maintained and of interest?

2008-04-19 Thread Michael Lawrence
of us is interested in using a general > interface code > | generation mechanism, then perhaps we shouldn't waste too much time on > such > | general resources. However, I think it is of value and I think > | we can fix up the SWIG module with a little collaboration. > > There

Re: [Rd] swig 1.3.35 & R - is the R wrapper still maintained and of interest?

2008-04-20 Thread Michael Lawrence
ave been working on an alternative way to generate > bindings using > | | output from GCC (gcc & g++) and exploring how the bindings should work > | > | Sure, that is very well for you as a research project, > ~ Thanks! > | but Swig is there, is > | rather mature, und

Re: [Rd] New version of X11, png and jpeg

2008-04-30 Thread Michael Lawrence
On Wed, Apr 30, 2008 at 10:26 AM, Maarten Blaauw <[EMAIL PROTECTED]> wrote: > > The now default Cairo results in much prettier graphs, but dense graphs > such > as plot(rnorm(1e4)) take considerably longer to plot than using > X11(type="Xlib"). This has already been mentioned, but I was wondering

[Rd] is() and S3 classes

2008-06-04 Thread Michael Lawrence
The is() function begins with the following code: cl <- class(object) if (length(cl) > 1) { if (is.na(match(cl[[1]], names(getClass("oldClass")@subclasses return(class2 %in% cl) As one can see, it uses S3 inheritance if the first element of the class attribute is a

Re: [Rd] is() and S3 classes

2008-06-04 Thread Michael Lawrence
On Wed, Jun 4, 2008 at 8:05 PM, Michael Lawrence <[EMAIL PROTECTED]> wrote: > The is() function begins with the following code: > > cl <- class(object) > if (length(cl) > 1) { > if (is.na(match(cl[[1]], names(getClass("oldClass")@subclasses)

Re: [Rd] show vs print (Re: Error in "getClass" when calling the function "show")

2008-06-10 Thread Michael Lawrence
On Tue, Jun 10, 2008 at 8:07 AM, John Chambers <[EMAIL PROTECTED]> wrote: > It's now perhaps only a historical point, but one motivation for > introducing show() in S4 was the thought that something other than > "printing" might evolve to be better for "showing" an object (e.g., a method > that di

Re: [Rd] equivalent to "require" for imports? (cairoDevice)

2008-07-28 Thread Michael Lawrence
On Mon, Jul 28, 2008 at 6:33 AM, Prof Brian Ripley <[EMAIL PROTECTED]>wrote: > On Mon, 28 Jul 2008, Felix Andrews wrote: > > Hi R-devel >> >> I use the packages RGtk2 and cairoDevice. The cairoDevice package has >> a few stand-alone functions, plus "asCairoDevice" which depends on >> RGtk2 and ca

Re: [Rd] RGtk2 on linux: "stack smashing detected"

2008-08-06 Thread Michael Lawrence
Yea I am aware of this. This is because the Ubuntu binary has stack smashing detection enabled. It's possible to build R without this checking: export CFLAGS="-fno-stack-protector" I have not been able to figure out why stack smashing is detected. I'm cc'ing this to r-devel in case anyone else h

Re: [Rd] [Bioc-devel] EBImage: Devel version on Windows not building

2008-08-13 Thread Michael Lawrence
event loop handling, so that package code is the same across platforms. I understand that's a non-trivial task. Michael > > > L. > > > > 2008/8/13 Michael Lawrence <[EMAIL PROTECTED]>: > > This is almost certainly due to the lack of tcl_do in R devel. I fi

[Rd] Rterm.exe, windows event loop running in multiple threads?

2008-09-18 Thread Michael Lawrence
For processing events, RGtk2 has moved away from using the old tcl_do hack and now synchronizes on the Windows event loop. In Rgui.exe this works fine (well mostly), but in Rterm.exe, users report the following warning from GLib: "main loop already active in another thread". The most obvious way th

Re: [Rd] Rterm.exe, windows event loop running in multiple threads?

2008-09-18 Thread Michael Lawrence
On Thu, Sep 18, 2008 at 6:28 AM, Duncan Murdoch <[EMAIL PROTECTED]>wrote: > On 18/09/2008 8:59 AM, Michael Lawrence wrote: > >> For processing events, RGtk2 has moved away from using the old tcl_do hack >> and now synchronizes on the Windows event loop. In Rgui.exe thi

Re: [Rd] Rterm.exe, windows event loop running in multiple threads?

2008-09-29 Thread Michael Lawrence
On Thu, Sep 18, 2008 at 7:04 AM, Simon Anders <[EMAIL PROTECTED]> wrote: > Hi Michael, > > Michael Lawrence wrote: > >>> For processing events, RGtk2 has moved away from using the old tcl_do > hack > >>> and now synchronizes on the Windows event loop. In

[Rd] wish: exportClassPattern

2008-11-21 Thread Michael Lawrence
It would be nice to have a more convenient means of exporting multiple classes from a package namespace. Why not have something like exportClassPattern() that worked like exportPattern() except for classes? Thanks, Michael [[alternative HTML version deleted]]

[Rd] dots methods: dispatch issues

2008-11-25 Thread Michael Lawrence
There seems to be a bug arising when using multiple S4 generics with "..." as the signature. The following code works as expected: ## > setGeneric("rbind", function(..., deparse.level=1) standardGeneric("rbind"), +signature

Re: [Rd] dots methods: dispatch issues

2008-11-25 Thread Michael Lawrence
;numeric") > foo Method Definition (Class "derivedDefaultMethod"): function (..., deparse.level = 1) .Internal(rbind(deparse.level, ...)) Signatures: ... target "numeric" defined "numeric" > foo(1) [,1] [1,]1 > On Tue, Nov 25, 2008 at

Re: [Rd] S4 coercion

2008-12-11 Thread Michael Lawrence
Hi, I am having a similar issue as reported by Paul, but I don't think Martin's example is precisely representative of the problem. Consider a hierarchy A <- B <- C: > setClass("A") [1] "A" > setClass("B", contains="A") [1] "B" > setClass("C", contains="B") [1] "C" Now define a coerce method:

Re: [Rd] interactive graphics for R: was Google Summer of Code 2009

2009-02-20 Thread Michael Lawrence
On Thu, Feb 19, 2009 at 9:27 AM, Sklyar, Oleg (London) < oskl...@maninvestments.com> wrote: > Dear Simon, > > thanks for comments. > > I better give a bit of a background first. We are analysing time series of > financial data, often multivariate and with say 200K samples. It is quite a > frequent

<    1   2   3   >