Re: [Rd] Rcpp too good to be true?

2011-12-13 Thread Martin Morgan
On 12/13/2011 03:48 PM, Jeffrey Pollock wrote: Hello all, I've been working on a package to do various things related to the Conway-Maxwell-Poisson distribution and wanted to be able to make fast random draws from the distribution. My R code was running quite slow so I decided to give Rcpp a bas

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

2011-12-15 Thread Martin Morgan
In > R.version.string [1] "R Under development (unstable) (2011-12-15 r57901)" section 1.6.6 of 'Writing R Extensions' says Note that exporting methods on a generic in the namespace will also export the generic, and exporting a generic in the namespace will also export its methods. and

[Rd] R CMD check fails to warn about undocumented classes and methods

2011-12-15 Thread Martin Morgan
In > R.version.string [1] "R Under development (unstable) (2011-12-15 r57901)" PkgA promotes 'unique' to a generic and exports that DESCRIPTION: Imports: methods R/f.R: setGeneric("unique") NAMESPACE: export(unique) and PkgB creates and exports a method on unique DESCRIPTION

Re: [Rd] R CMD check fails to warn about undocumented classes and methods

2011-12-15 Thread Martin Morgan
On 12/15/2011 03:40 PM, Martin Morgan wrote: In > R.version.string [1] "R Under development (unstable) (2011-12-15 r57901)" PkgA promotes 'unique' to a generic and exports that DESCRIPTION: Imports: methods R/f.R: setGeneric("unique") NAMESPACE: export(uniq

Re: [Rd] R CMD check fails to warn about undocumented classes and methods

2011-12-16 Thread Martin Morgan
On 12/16/2011 02:02 AM, Martin Maechler wrote: On 12/15/2011 03:40 PM, Martin Morgan wrote: In > R.version.string [1] "R Under development (unstable) (2011-12-15 r57901)" PkgA promotes 'unique' to a generic and exports that DESCRIPTION: Imports: methods R/

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

2011-12-16 Thread Martin Morgan
tar of Pkgs A, B, C attached. Martin On 12/15/2011 03:34 PM, Martin Morgan wrote: In > R.version.string [1] "R Under development (unstable) (2011-12-15 r57901)" section 1.6.6 of 'Writing R Extensions' says Note that exporting methods on a generic in the namespa

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

2011-12-16 Thread Martin Morgan
y if the generic found in either PkgB's namespace or namespace imports were imported along with the method. Not sure that I like the idea of calling setGeneric() -- PkgA could have done something non-standard -- and would rather an error. Thans for your attention. Martin Comments? John O

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

2011-12-22 Thread Martin Morgan
if the generic function was created from base::unique by the standard call. That's what would make an automatic imputation of the generic from importMethods() possible. On 12/16/11 2:57 PM, Martin Morgan wrote: On 12/16/2011 12:19 PM, John Chambers wrote: The subject heading is correct if referrin

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Martin Morgan
On 12/23/2011 11:54 AM, Hadley Wickham wrote: And one last note: I'm reasonably certain I haven't forgotten to export an S3 method because I wrote the following script to (crudely) compare the function definitions in ggplot2 with its namespace: ns<- parseNamespaceFile("ggplot", "~/Documents/g

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Martin Morgan
On 12/23/2011 02:11 PM, Martin Morgan wrote: On 12/23/2011 11:54 AM, Hadley Wickham wrote: And one last note: I'm reasonably certain I haven't forgotten to export an S3 method because I wrote the following script to (crudely) compare the function definitions in ggplot2 with its name

Re: [Rd] Debugging namespace problems

2011-12-23 Thread Martin Morgan
On 12/23/2011 02:38 PM, Hadley Wickham wrote: in scales_add_defaults, where the symbol isn't found in the globalenv() when nstest is attached and ggplot2 only loaded, but is (via the search path) when ggplot2 is attached. and topenv(parent.frame()) is a replacement that gets to .GlobalEnv for g

[Rd] interesting connection / finalizer bug?

2012-01-06 Thread Martin Morgan
This setOldClass(c("file", "connection")) .A <- setRefClass("A", fields=list(con="connection"), methods=list( finalize = function() { if (isOpen(con)) close(con) })) f <- tempdir() a <- .A$new(con=file(f, "rb")) cl

Re: [Rd] serializing recordedplot object

2012-01-10 Thread Martin Morgan
On 01/10/2012 02:54 PM, Simon Urbanek wrote: On Jan 10, 2012, at 4:12 PM, Jeroen Ooms wrote: On Tue, Jan 10, 2012 at 6:17 AM, Simon Urbanek wrote: Unfortunately R doesn't provide a way for this. Without changes to unserialization (on the wishlist for a few years now, but not easy to design)

Re: [Rd] Resume processing after warning handler.

2012-02-04 Thread Martin Morgan
On 02/03/2012 02:49 AM, Titus von der Malsburg wrote: Dear list! I have a script that processes a large number of data files. When one file fails to process correctly, I want the script to write a message and to continue with the next file. I achieved this with tryCatch: for (f in files)

Re: [Rd] Resume processing after warning handler.

2012-02-06 Thread Martin Morgan
On 02/06/2012 04:46 AM, Titus von der Malsburg wrote: On Sat, Feb 4, 2012 at 4:37 PM, Martin Morgan wrote: On 02/03/2012 02:49 AM, Titus von der Malsburg wrote: Hi Titus -- use withCallingHandlers to capture the warning, and invokeRestart() to continue after handling it. withCallingHandlers

Re: [Rd] mem.limits deprecated

2012-02-06 Thread Martin Morgan
On 02/06/2012 12:45 PM, Jeroen Ooms wrote: After upgrading my servers to 2.14, log files were filled warnings that 'mem.limits' has been deprecated and to use gc instead. After reading the NEWS for R 2.14.0 and PR#14795 I learned that it is actually deprecated without replacement. Hereby I just

Re: [Rd] capture.output() is trying to allocate 17179869182.6 Gb on my not so big data.frame

2012-02-07 Thread Martin Morgan
the function; the return in the _PRINT_DEAL_c_eq_0 macro makes it difficult to balance the protection stack, and R_alloc seems to be a better solution anyway. diff attached. Martin Morgan I get something similar with R 2.14.1. Cheers, H. > sessionInfo() R Under development (unstable) (

Re: [Rd] method using several (and different) arguments in turn

2012-02-14 Thread Martin Morgan
On 02/14/2012 08:43 AM, james.fo...@diamond.ac.uk wrote: Dear R-developers community, I have the following generic: setGeneric( name="newsample", def=function(x,y,z,a,b,c,...){standardGeneric("newsample")} And I can build several methods for this generic.

[Rd] Parallel R CMD check?

2012-02-16 Thread Martin Morgan
Running R CMD check on a package can take quite a lot of time. Checks seem like they could be run in parallel (separate processes for, e.g., codoc, examples, tests, ...). Is there a way to do this? My current usage is typically R CMD build R CMD check pkg_x.y.z.tar.gz Thanks for any hi

Re: [Rd] Parallel R CMD check?

2012-02-17 Thread Martin Morgan
On 02/17/2012 01:42 AM, Prof Brian Ripley wrote: On 17/02/2012 06:50, Martin Morgan wrote: Running R CMD check on a package can take quite a lot of time. Checks seem like they could be run in parallel (separate processes for, e.g., codoc, examples, tests, ...). Is there a way to do this? My

Re: [Rd] Why cant my S4 class have a slot named `C`?

2012-02-21 Thread Martin Morgan
On 02/21/2012 08:13 AM, Steve Lianoglou wrote: Hi all, This feature was throwing me for a loop for quite some time until I played with the names of the slots. Consider exhibit A: == setClass("SVM", representation=representation( x='numeric', y='num

[Rd] improved error message when existing implicit S4 generic is not imported?

2012-02-25 Thread Martin Morgan
pkgA's NAMESPACE has importFrom(graphics, plot) exportClasses("A") exportMethods("plot") R/foo.R has setClass("A") setMethod("plot", "A", function(x, y, ...) {}) During R CMD INSTALL pkgA_1.0.tar.gz we are told ** preparing package for lazy loading Creating a generic function for 'p

[Rd] Comments on R_exts section 1.6.6, Namespaces with S4 classes and methods

2012-02-26 Thread Martin Morgan
> R.version.string [1] "R Under development (unstable) (2012-02-26 r58493)" In the recent addition "It is important if you export S4 methods that the corresponding generics are available: the requirementa on this are stricter as from R 2.15.0. You may for example need to import plot from graph

[Rd] methods::trace fails when signature specified

2012-03-14 Thread Martin Morgan
With > R.version.string [1] "R version 2.15.0 alpha (2012-03-14 r58748)" trying to trace a method using the 'signature' argument fails rather than enabling the trace: > trace(initialize, signature="ANY") Error in matchSignature(signature, fdef, where) : trying to match a method signature of

Re: [Rd] Dealing with printf() &c. in third-party library code

2012-03-14 Thread Martin Morgan
On 03/14/2012 05:15 AM, Jon Clayden wrote: Dear all, I recognise the reason for strongly discouraging use of printf() and similar C functions in R packages, but I wonder what people do in practice about third-party code which may be littered with such calls. I maintain a package (RNiftyReg) whic

Re: [Rd] Dealing with printf() &c. in third-party library code

2012-03-15 Thread Martin Morgan
re I still reference stderr / stdout. But it seems like the meaningful problem (writing to stderr / stdout, which R might have re-directed) has been addressed (except for the third branch, in your code above). Martin All the best, Jon On 15 March 2012 05:04, Martin Morgan wrote: On 03/14/201

Re: [Rd] R-2.15.0 and Exporting Methods Converted To S4 Generic

2012-04-13 Thread Martin Morgan
On 04/13/2012 01:40 AM, Uwe Ligges wrote: You have to export the new generic as well. that's not correct. Uwe Ligges On 12.04.2012 20:41, Roebuck,Paul L wrote: Late to the show on this release, unfortunately. One of our production packages no longer builds under R-2.15.0 with the followin

Re: [Rd] How to list package dependency on a Bioconductor package?

2012-05-08 Thread Martin Morgan
tat.ethz.ch/mailman/**listinfo/r-devel<https://stat.ethz.ch/mailman/listinfo/r-devel> [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel ____

Re: [Rd] R package dependency issues when namespace is not attached

2012-05-13 Thread Martin Morgan
On 05/13/2012 12:14 PM, Jeroen Ooms wrote: On Sun, May 13, 2012 at 10:14 AM, Uwe Ligges wrote: I do not see any problem in R. If someone is going to import a Namespace, he or she has to do that via import directives in the NAMESPACE file. If someone is going to have a package on the search pa

Re: [Rd] R package dependency issues when namespace is not attached

2012-05-13 Thread Martin Morgan
On 05/13/2012 01:39 PM, Duncan Murdoch wrote: On 12-05-13 4:06 PM, Martin Morgan wrote: On 05/13/2012 12:14 PM, Jeroen Ooms wrote: On Sun, May 13, 2012 at 10:14 AM, Uwe Ligges wrote: I do not see any problem in R. If someone is going to import a Namespace, he or she has to do that via

Re: [Rd] "Incompatible methods" for overloaded operator

2012-06-20 Thread Martin Morgan
On 06/20/2012 07:25 PM, Hadley Wickham wrote: Hi all, Any ideas about this? As far as I can tell it should work - and I don't understand why it's ok when run outside of a package. from ?groupGeneric under 'Ops' (of which "+" is one) used. If different methods are found, there is a

Re: [Rd] S4 Reference Classes: declaring public and private methods

2012-06-20 Thread Martin Morgan
On 06/18/2012 01:01 AM, Janko Thyson wrote: Dear list, is there a way to declare public and private methods in S4 Reference Classes? If not, are there plans to add such a feature? Hi Janko -- your question is a little ambiguous; if it's about a built-in facility to create public vs. private m

Re: [Rd] "Incompatible methods" for overloaded operator

2012-06-20 Thread Martin Morgan
On 06/20/2012 08:06 PM, Hadley Wickham wrote: from ?groupGeneric under 'Ops' (of which "+" is one) used. If different methods are found, there is a warning about 'incompatible methods': in that case or if no method is found for either argument the internal method i

Re: [Rd] Dependency problem for "hasArg"

2012-07-02 Thread Martin Morgan
On 07/02/2012 06:23 PM, Charlie Friedemann wrote: The error message you are getting makes it rather clear what the problem is. R is unable to find the function 'hasArg'. As the hasArg function is part of the package 'methods', a solution would be to put require(methods) at the beginning of your

Re: [Rd] Dependency problem for "hasArg"

2012-07-03 Thread Martin Morgan
On 07/03/2012 09:07 AM, Mauricio Zambrano-Bigiarini wrote: On 02/07/12 22:51, Martin Morgan wrote: On 07/02/2012 06:23 PM, Charlie Friedemann wrote: The error message you are getting makes it rather clear what the problem is. R is unable to find the function 'hasArg'. As the hasArg f

Re: [Rd] Are R packages supposed to be "relocatable"? (avoiding BioConductor scripts...)

2012-07-19 Thread Martin Morgan
cation to avoid confusion (avoiding 'first time users should do A, return users should do B'). As a 'normal' user it is safe and appropriate to use biocLite to manage Bioconductor (and CRAN) packages. One takes a more cautious approach as 'root', but I personally

[Rd] setMethod sometimes fails to set package slot when signature has trailing 'ANY'

2012-08-05 Thread Martin Morgan
after this setClass("A") setGeneric("bar", function(x, y) standardGeneric("bar")) setMethod(bar, signature(x="A", y="A"), function(x, y) {}) setMethod(bar, signature(x="A", y="ANY"), function(x, y) {}) the method for signature c("A", "A") contains package information > str(getMethod(ba

Re: [Rd] setMethod sometimes fails to set package slot when signature has trailing 'ANY'

2012-08-07 Thread Martin Morgan
On 08/07/2012 02:43 PM, John Chambers wrote: Good catch. This should have been fixed in r-devel, revision 60192. If nothing bad results in other tests, we'll port it to the current patched version. Thank you for the fix. Martin Thanks, John On 8/5/12 4:31 PM, Martin Morgan

Re: [Rd] [R] debug vs regular mode

2012-08-10 Thread Martin Morgan
On 08/10/2012 12:04 PM, peter dalgaard wrote: Not to spoil your fun, but this is getting a bit off-topic for R-help. If you wish to continue the debugging process in public, I think you should move to R-devel. Also, it sounds like the problem is in the glmulti package, so you might want to in

[Rd] data() documentation ambiguous about loaded versus attached packages?

2012-08-17 Thread Martin Morgan
Under ?data package: a character vector giving the package(s) to look in for data sets, or 'NULL'. By default, all packages in the search path are used, then the 'data' subdirectory (if present) of the current working directory. which I think is accurate

[Rd] mccollect does not return named, ordered results when wait=FALSE

2012-08-18 Thread Martin Morgan
?mccollect say 'mccollect' returns any results that are available in a list. The results will have the same order as the specified jobs. If there are multiple jobs and a job has a name it will be used to name the result, otherwise its process ID will be used. If none of the

[Rd] parLapply fails to detect default cluster?

2012-08-21 Thread Martin Morgan
invoking parLapply without a cluster fails to find a previously registered cluster > library(parallel) > setDefaultCluster(makePSOCKcluster(2)) > parLapply(X=1:2, fun=function(...) {}) Error in cut.default(i, breaks) : invalid number of intervals This is because in parLapply length(cl) is deter

Re: [Rd] parLapply fails to detect default cluster?

2012-08-28 Thread Martin Morgan
Thank you for the fix, in svn R-devel and 2-15-patched r60447, r60448. Martin On 08/21/2012 06:50 AM, Martin Morgan wrote: invoking parLapply without a cluster fails to find a previously registered cluster > library(parallel) > setDefaultCluster(makePSOCKcluster(2)) > parLapply(X

[Rd] stack overflow? was Re: [R] segfault in gplots::heatmap.2

2012-08-30 Thread Martin Morgan
I think this belongs on R-devel and I'm forwarding there. Here's a more refined example library("XLConnect") load(file="ddr.Rda") oV <- function(x) { if (is.leaf(x)) { return(x) } for (j in seq_along(x)) { b <- oV(x[[j]]) } x } res <-

[Rd] all.equal on external pointers and environments

2012-09-05 Thread Martin Morgan
For an external pointer > xp one might expect all.equal to behave as for environments > e = new.env() > all.equal(e, e) [1] TRUE but it does not > all.equal(xp, xp) Error in unclass(target) : cannot unclass an external pointer A solution is to dispatch to all.equal.language (?) in src/libr

Re: [Rd] Is invokeRestart("abort") unstoppable?

2012-09-11 Thread Martin Morgan
On 09/11/2012 04:19 PM, Henrik Bengtsson wrote: Hi, I'm trying to implement an abort() method that works just like stop() but does not signal the condition such that try() and tryCatch(..., condition=...) are, contrary to stop(), effectively non-working with abort() calls. In order to achieve t

[Rd] methods cbind2 bind_activation disrupts cbind everywhere

2012-09-12 Thread Martin Morgan
a safe way for a package to use cbind2? This came up in the context of complex package dependencies in Bioconductor, as detailed in this thread (sorry for the html). https://stat.ethz.ch/pipermail/bioc-devel/2012-September/003617.html -- Dr. Martin Morgan Fred Hutchinson Cancer Research Center

Re: [Rd] methods cbind2 bind_activation disrupts cbind everywhere

2012-09-15 Thread Martin Morgan
option is wholesale deprecation of S4 ... but I won't start that conversation with either of you ;-) Jeff On Fri, Sep 14, 2012 at 3:00 AM, Martin Maechler wrote: Martin Morgan on Wed, 12 Sep 2012 15:23:02 -0700 writes: > The methods package ?cbind2 includes the instru

Re: [Rd] different behavior accessing type-specific as.data.frame inside a function vs inside R shell

2012-09-19 Thread Martin Morgan
we are all novice R developers am hoping someone on the list can provide some insight. many thanks for your time, brian [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Dr. Martin Morgan, PhD Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Segmentation fault when options(max.print = .Machine$integer.max)

2012-09-24 Thread Martin Morgan
Seemed like a good idea at the time, but > options(max.print = .Machine$integer.max) > 1:10 [1] Program received signal SIGSEGV, Segmentation fault. because of an integer overflow at src/main/printvector.c:176 > sessionInfo() R Under development (unstable) (2012-09-24 r60800) Platf

Re: [Rd] Segmentation fault when options(max.print = .Machine$integer.max)

2012-09-25 Thread Martin Morgan
On 09/25/2012 05:26 AM, Martin Maechler wrote: Seemed like a good idea at the time, I'm curious. Why is it (setting max.print much too large) a good idea? I usually set it considerably smaller (50) than default to conserve screen real estate, but then occasionally need to see more than my

Re: [Rd] S4method

2012-09-28 Thread Martin Morgan
On 09/28/2012 11:57 AM, David L Lorenz wrote: I get an error when I try to use \S4method in a usage section in an Rd file for a function. I tried to duplicate exactly how stats4 documents its method functions, but I must be missing something. Here is the top part of the Rd file: \name{xyPlot-met

Re: [Rd] Fastest non-overlapping binning mean function out there?

2012-10-03 Thread Martin Morgan
On 10/02/2012 05:19 PM, Henrik Bengtsson wrote: Hi, I'm looking for a super-duper fast mean/sum binning implementation available in R, and before implementing z = binnedMeans(x y) in native code myself, does any one know of an existing function/package for this? I'm sure it already exists. So,

Re: [Rd] Fastest non-overlapping binning mean function out there?

2012-10-03 Thread Martin Morgan
On 10/3/2012 6:47 AM, Martin Morgan wrote: On 10/02/2012 05:19 PM, Henrik Bengtsson wrote: Hi, I'm looking for a super-duper fast mean/sum binning implementation available in R, and before implementing z = binnedMeans(x y) in native code myself, does any one know of an existing fun

[Rd] identical() fails to compare isS4() to TRUE

2012-10-04 Thread Martin Morgan
> setClass("A", "integer") > isS4(new("A")) [1] TRUE > identical(isS4(new("A")), TRUE) [1] FALSE > sessionInfo() R Under development (unstable) (2012-10-04 r60876) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC

Re: [Rd] identical() fails to compare isS4() to TRUE

2012-10-04 Thread Martin Morgan
On 10/04/2012 02:23 PM, Duncan Murdoch wrote: On 12-10-04 4:57 PM, Martin Morgan wrote: > setClass("A", "integer") > isS4(new("A")) [1] TRUE > identical(isS4(new("A")), TRUE) [1] FALSE > sessionInfo() R Under development (unstable

Re: [Rd] identical() fails to compare isS4() to TRUE

2012-10-04 Thread Martin Morgan
On 10/04/2012 04:05 PM, Duncan Murdoch wrote: On 12-10-04 5:50 PM, Martin Morgan wrote: On 10/04/2012 02:23 PM, Duncan Murdoch wrote: On 12-10-04 4:57 PM, Martin Morgan wrote: > setClass("A", "integer") > isS4(new("A")) [1] TRUE > id

Re: [Rd] identical() fails to compare isS4() to TRUE

2012-10-05 Thread Martin Morgan
On 10/04/2012 05:56 PM, Martin Morgan wrote: On 10/04/2012 04:05 PM, Duncan Murdoch wrote: On 12-10-04 5:50 PM, Martin Morgan wrote: On 10/04/2012 02:23 PM, Duncan Murdoch wrote: On 12-10-04 4:57 PM, Martin Morgan wrote: > setClass("A", "integer") &g

[Rd] S4 fails to initialize linear hierarchies with intermediate VIRTUAL classes

2012-10-18 Thread Martin Morgan
Initialization of this simple hierarchy A = setClass("A", representation(x="numeric")) setClass("B", contains=c("VIRTUAL", "A")) C = setClass("C", contains="B") fails (neat that setClass returns generators; I hadn't realized that before!) > C(A()) Error: evaluation nested too deeply: infi

Re: [Rd] suppress *specific* warnings?

2012-10-21 Thread Martin Morgan
On 10/21/2012 12:28 PM, Ben Bolker wrote: Not desperately important, but nice to have and possibly of use to others, is the ability to suppress specific warnings rather than suppressing warnings indiscriminately. I often know of a specific warning that I want to ignore (because I know that's

Re: [Rd] suppress *specific* warnings?

2012-10-23 Thread Martin Morgan
On 10/22/2012 09:57 AM, luke-tier...@uiowa.edu wrote: On Sun, 21 Oct 2012, Martin Morgan wrote: On 10/21/2012 12:28 PM, Ben Bolker wrote: Not desperately important, but nice to have and possibly of use to others, is the ability to suppress specific warnings rather than suppressing

[Rd] parallel::pvec FUN types differ when v is a list; code simplifications?

2012-10-25 Thread Martin Morgan
iocGenerics. Maybe I am missing something obvious here, but imo there is no way to overwrite parLapply globally for my own class unless the generic is imported by everyone who wants to make use of the special method. Florian -- On 10/23/12 2:20 PM, "Martin Morgan" wrote: On 10/17/

[Rd] parallel::mclapply list coercion limits opportunities for code re-use?

2012-11-04 Thread Martin Morgan
The attached diff address the following issues in mclapply mclapply coerces non-lists or objects (S3 or S4) to lists, but a list may not be an efficient representation and is not required if the object implements length, [, and [[ methods (lapply must also work on the object, either through coe

[Rd] namespace S3 and S4 generic imports cannot both be satisfied:

2012-12-08 Thread Martin Morgan
S3 and S4 symbols defined, but this seems to be required? A workaround might extend the check to include getGeneric(genname)@default. This scenario is reproducible in the attached tarball tar xzf PkgAB.tar.gz R CMD INSTALL PkgA R CMD check PkgB Martin Morgan -- Computational Biology / Fre

Re: [Rd] namespace S3 and S4 generic imports cannot both be satisfied:

2012-12-14 Thread Martin Morgan
real example. Martin Thanks for the catch. John On 12/8/12 3:05 PM, Martin Morgan wrote: PkgA wishes to write a method for 'unique' on S4 class 'A'. ?Methods indicates that one should setGeneric("unique") setClass("A") unique.A <- function(x,

Re: [Rd] Strange, most probably unjustified, codoc mismatch for S4 method with one argument plus '...' (re-try)

2012-12-14 Thread Martin Morgan
On 12/14/2012 09:46 AM, Ulrich Bodenhofer wrote: Hi, I just figured out that I accidentally posted my message in HTML, so I am retrying in plain text only. Sorry. I am currently extending one of our CRAN packages and ran into an unexpected problem when checking the source package. I got some wa

Re: [Rd] Strange, most probably unjustified, codoc mismatch for S4 method with one argument plus '...' (re-try)

2012-12-17 Thread Martin Morgan
On 12/17/2012 12:57 AM, Ulrich Bodenhofer wrote: On 12/15/2012 06:26 AM, Martin Morgan wrote: In ?setMethod there is this paragraph It is possible to have some differences between the formal arguments to a method supplied to 'setMethod' and those of the generic. Rough

[Rd] improved methods error

2012-12-20 Thread Martin Morgan
While trying to install a package, I received this error ** preparing package for lazy loading Error in matchSignature(signature, fdef, where) : more elements in the method signature (2) than in the generic signature (1) A more helpful variant is Error in matchSignature(signature, fdef, wher

[Rd] bug and enhancement to split?

2013-01-27 Thread Martin Morgan
With > R.version.string [1] "R Under development (unstable) (2013-01-26 r61752)" 'split.default' recycles a short factor for unclassed 'x', but not for an instance of x that is a class > split(1:5, 1:2) $`1` [1] 1 3 5 $`2` [1] 2 4 Warning message: In split.default(1:5, 1:2) : data length

Re: [Rd] setGeneric() gives "must supply skeleton" when checking package

2013-02-03 Thread Martin Morgan
ction." You haven't mentioned your DESCRIPTION or NAMEPSACE file, but the right thing to do is DESCRIPTION: Depends: reshape NAMESPACE: importFrom(reshape, cast) R/somefile.R: setGeneric("cast") Perhaps your current setGeneric is being performed inside the namespace w

Re: [Rd] setGeneric() gives "must supply skeleton" when checking package

2013-02-03 Thread Martin Morgan
On 02/03/2013 09:36 AM, Martin Morgan wrote: On 02/02/2013 02:34 PM, Tim Bergsma wrote: r-devel, In a development version of the CRAN package metrumrg, I write ... require(reshape) setGeneric('cast') setOldClass(c('keyed','data.frame')) setMethod('cast

[Rd] How to NAMESPACE OS-specific importFrom?

2013-02-06 Thread Martin Morgan
I be doing if (tools:::.OStype() == "unix") { importFrom(parallel, mccollect, mcparallel) } in my NAMESPACE? I have a recollection that this has come up before, perhaps even in the parallel package, but I'm not able to find anything. Thanks, Martin Morgan -- Computational Bi

Re: [Rd] Recommended way to call/import functions from a Suggested package

2013-02-25 Thread Martin Morgan
On 02/25/2013 01:28 PM, Hadley Wickham wrote: To summarize, it appears that the only way to call functions from a suggested package is by using either 'require' (which will dynamically attach it) or the double colon method. Is this something that should be mentioned in R-exts? Except the double

[Rd] Missing PROTECT in mkPRIMSXP ?

2013-03-03 Thread Martin Morgan
- dstruct.c (revision 62113) +++ dstruct.c (working copy) @@ -59,6 +59,7 @@ if (result == R_NilValue) { result = allocSExp(type); SET_PRIMOFFSET(result, offset); + SET_VECTOR_ELT(PrimCache, offset, result); } else if (TYPEOF(result) != type) error("reque

[Rd] S4 generic not exported correctly / incorrect dispatch?

2013-03-13 Thread Martin Morgan
In this post https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004152.html a package author reports that S4 dispatch fails. I can reproduce this with a PkgA (attached; 'intervals' is a relatively light-weight CRAN package) that has DESCRIPTION with Depends: intervals Imports: graphics

Re: [Rd] S4 generic not exported correctly / incorrect dispatch?

2013-03-15 Thread Martin Morgan
On 03/15/2013 04:42 AM, Martin Maechler wrote: Martin Morgan on Wed, 13 Mar 2013 12:43:59 -0700 writes: > In this post > https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004152.html > a package author reports that S4 dispatch fails. I can reproduce thi

[Rd] configure.ac clock_gettime (and R_CHECK_FUNCS) incorrect?

2013-03-16 Thread Martin Morgan
When R is configured with CFLAGS=-O2, clock_gettime is included $ nm src/main/libR.a | grep clock_gettime U clock_gettime whereas when configured with -O0 it is not $ nm src/main/libR.a | grep clock_gettime $ Similarly when built as a shared library the linker flags include or

Re: [Rd] missing exported methods when compiling vignettes in R 3.0.0 RC

2013-04-01 Thread Martin Morgan
On 04/01/2013 05:37 PM, Henrik Bengtsson wrote: Hi, things have indeed changed on how non-Sweave vignettes are built (this happened around R devel 2013-03-05 r62130). However, it's not clear to me what changes would be behind your problems, if any. Build your vignette with the following buildV

Re: [Rd] question re: error message --- package error: "functionName" not resolved from current namespace

2013-04-10 Thread Martin Morgan
For what it's worth, the package loads many DLLs in its NAMESPACE via repeated calls to useDynLib. antsImageRead is not in the first DLL loaded, and from NEWS.Rd, the problem comes from o A foreign function call (.C() etc) in a package without a PACKAGE argument will only look in

Re: [Rd] R 3.0.0 memory use

2013-04-14 Thread Martin Morgan
On 04/14/2013 07:11 PM, luke-tier...@uiowa.edu wrote: There were a couple of bug fixes to somewhat obscure compound assignment related bugs that required bumping up internal reference counts. It's possible that one or more of these are responsible. If so it is unavoidable for now, but it's worth

Re: [Rd] Suppress specific warnings

2013-04-18 Thread Martin Morgan
muffleWarning") } ) ...which are then caught as withCallingHandlers({ warning(w) # 'curves'; caught warning("another warning") }, curves=function(w) invokeRestart("muffleWarning")) The tricky part is to come

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

2013-04-19 Thread Martin Morgan
On 04/19/2013 01:16 AM, Prof Brian Ripley wrote: On 17/04/2013 21:25, Michael Lawrence wrote: 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 f

Re: [Rd] Speeding up build-from-source

2013-04-27 Thread Martin Morgan
On 04/26/2013 07:50 AM, Adam Seering wrote: Hi, I've been playing around with the R source code a little; mostly just trying to familiarize myself. I have access to some computers on a reservation system; so I've been reserving a computer, downloading and compiling R, and going from there.

Re: [Rd] loading of an unwanted namespace

2013-05-02 Thread Martin Morgan
On 05/02/2013 01:35 PM, Duncan Murdoch wrote: On 13-05-02 3:05 PM, Terry Therneau wrote: I have a debugging environment for the survival package, perhaps unique to me, but I find it works very well. To wit, a separate directory with copies of the source code but none of the package accuements of

Re: [Rd] Dependencies of Imports not attached?

2013-05-08 Thread Martin Morgan
On 05/08/2013 10:25 AM, Simon Urbanek wrote: On May 7, 2013, at 11:35 PM, Peter Meilstrup wrote: Encountered an error in scripting, which can be reproduced using Rscript as follows: $ Rscript -e "library(httr); handle('http://cran.r-project.org')" Error in getCurlHandle(cookiefile = cookie_p

Re: [Rd] S4 method dispatch and namespaces: why is default method selected

2009-05-18 Thread Martin Morgan
axes = axes, asp = asp, ...) > } > .local(x, y, ...) > } > > > Signatures: > xy > target "pixmap" "missing" > defined "pixmap" "ANY" > > > > > >> sessionInfo() > R version 2.9.0 (2009-04-17) >

[Rd] install.packages now intentionally references .Rprofile?

2009-05-20 Thread Martin Morgan
S.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base Martin -- Martin Morgan Computational Biology / F

Re: [Rd] S4 Objects [Sec=Unclassified]

2009-06-02 Thread Martin Morgan
Hi Troy -- Troy Robertson wrote: > I am new to R programming but have dived into a medium sized modelling > software development project. > > Having come from a Java OO background I have a couple of questions about S4 > objects. > > > > Is there a way to make S4 slots (and methods) private a

Re: [Rd] Accessing an object from the function in its .Data slot?

2009-06-23 Thread Martin Morgan
Duncan Murdoch wrote: > Martin Kober wrote: >> I have an S4 object extending "function". Is it there a good way to >> access the object (resp. its slots) from within the function in .Data? >> > > I don't think so. That's not really the way the S4 object system is > designed to work. If a func

Re: [Rd] V2.9.0 changes [Sec=Unclassified]

2009-06-23 Thread Martin Morgan
Troy Robertson wrote: > Hi all, > > > > Prefix: I am a frustrated Java coder in R. ah good, if you're frustrated with Java you'll find R very different ;) > > > > I am coding a medium sized ecosystem modelling program in R. I have changed > to using S4 objects and it has cost me an order

Re: [Rd] R data inspection under gdb?

2009-06-25 Thread Martin Morgan
Hi Kynn -- (gdb) call Rf_PrintValue(x) 'void' is I think the return value of R_PV() Martin Kynn Jones wrote: > Hi, everyone. I'm trying to debug an R-module, written in C, and I'm using > gdb for this. > > How can I print "standard" R objects from within C code? > > BTW, I'm familiar with th

Re: [Rd] bug in Rf_PrintValue ?

2009-06-26 Thread Martin Morgan
Kynn Jones wrote: > I'm very green with R, so maybe this is not a bug, but it looks like one to > me. The following program segfaults at the second call to Rf_PrintValue(). > To failure depends on the value of the y-string. E.g., if I change it from > "coverage" to, say, "COVERAGE", the segfault

Re: [Rd] S4 and connection slot [Sec=Unclassified]

2009-06-29 Thread Martin Morgan
nction(.Object,.xData=new.env(parent=emptyenv())) { > .Object <- callNextMethod(.Object, .xData=.xData) > return(.Object) > } > ) > > s <- new("Element") > > > Not sure why that changes things though? &

Re: [Rd] S4 and connection slot [Sec=Unclassified]

2009-06-29 Thread Martin Morgan
Stavros Macrakis wrote: > On Mon, Jun 29, 2009 at 9:19 AM, Martin Morgan <mailto:mtmor...@fhcrc.org>> wrote: > > ...I'm not sure that including a connection in a slot is going to be > a good > idea, though -- a connection has reference-like semantics,

Re: [Rd] V2.9.0 changes [Sec=Unclassified]

2009-07-02 Thread Martin Morgan
Fish > Australian Antarctic Division > Channel Highway, Kingston 7050 > PH: 03 62323571 > troy.robert...@aad.gov.au > > >> -Original Message- >> From: Martin Morgan [mailto:mtmor...@fhcrc.org] >> Sent: Tuesday, 23 June 2009 11:25 PM >> To: Troy Robertson >> C

[Rd] factor() calls sort.list unnecessarily?

2009-07-03 Thread Martin Morgan
R-devel, factor(x) can take a long time on large character vectors (more than a minute in the example below). This is because of a call to sort.list. > str(x) chr [1:3436831] "chr5" "chr10" "chr16" "chr3" "chr4" "chr15" ... > Rprof("/tmp/factor.Rprof") > invisible(factor(x)) > Rprof() > summaryR

[Rd] tabulate can accept NA values?

2009-07-20 Thread Martin Morgan
s with (silently drops) NA. Perhaps the .C could have NAOK=TRUE? This is useful in apply'ing tabulate to the rows or columns of a (large) matrix, where the work-around involves introducing some artificial NA value (and consequently copying the matrix) outside the range of tabulate's nbin

Re: [Rd] RFC: methods() and showMethods() {was "debug"}

2009-07-30 Thread Martin Morgan
artly concrete proposals, partly just > ideas, asking for feedback, from you, experienced > programmeRs, ... > > Martin Maechler, ETH Zurich > > > --- > *1) as there will always be if the S4 methods > have been setup properly and *after* the S3 ones. > This will typica

Re: [Rd] S4 Generics and NAMESPACE : justified warning ?

2009-08-18 Thread Martin Morgan
Yohan Chalabi wrote: > Dear list, > > It seems that a package (pkgB) using another package (pkgA) with S4 > generics formed by taking existing functions (for example 'plot') must > not import the existing functions ('plot') in its namespace to avoid > the warning "replacing previous import: plot".

Re: [Rd] S4: inheritance of validity methods?

2009-08-18 Thread Martin Morgan
e a work around for this, or I am just doomed to write the same > validity method for each children class? I think you're doomed, but checking the number of slots in an instance seems like a very unusual validity method -- isn't this the job of the methods package, not your implement

<    1   2   3   4   5   >