Re: [Rd] Generalised piping into operators

2023-04-21 Thread Michael Milton
I'm afraid I don't understand. I know that parsing `+`(1, 1) returns a result equivalent to `1 + 1`, but why does that impose a restriction on parsing the pipe operator? What is the downside of allowing arbitrary RHS functions? [[alternative HTML version deleted]]

Re: [Rd] Generalised piping into operators

2023-04-22 Thread Michael Milton
x27;t realise!): > 1 |> `+`(x=_, 2) [1] 3 On Sat, Apr 22, 2023 at 3:00 AM Duncan Murdoch wrote: > On 21/04/2023 12:16 p.m., Michael Milton wrote: > > I'm afraid I don't understand. I know that parsing `+`(1, 1) returns a > > result equivalent to `1 + 1`, bu

[Rd] Forcing a PROTECT Bug to Occur

2023-04-29 Thread Michael Milton
I'm trying to learn about R's PROTECT system. To that end I've tried to create an example of C code that doesn't protect anything. I was hoping it would either segfault from trying to access deallocated memory, or maybe print out nonsense results because the unprotected memory got overwritten, but

Re: [Rd] [R-pkg-devel] Problem with "compacting" pdf files.

2023-10-02 Thread Michael Dewey
, why didn't you compress them then?". Thank you for your help on this. Michael On 02/10/2023 12:58, Ivan Krylov wrote: Dear Rolf, (Moving this one to R-devel...) On Sun, 1 Oct 2023 21:01:13 + Rolf Turner wrote: I *really* think that the instructions from CRAN could ha

[Rd] c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?

2023-11-05 Thread Michael Chirico
This is another follow-up to the thread from September "Recent changes to as.complex(NA_real_)". A test in data.table was broken by the changes for NA coercion to complex; the breakage essentially comes from c(NA, 0+1i) # vs c(as.complex(NA), 0+1i) The former is the output we tested against; the

Re: [Rd] c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?

2023-11-06 Thread Michael Chirico
main/bind.c#L418-L425 And indeed! It's not "coercion" in the sense I just described... there's a branch for the 'x == NA_LOGICAL' case to _convert_ to NA_complex_. On Mon, Nov 6, 2023 at 3:08 AM Martin Maechler wrote: > >>>>> Michael Chirico >

[Rd] readChar() could read the whole file by default?

2024-01-26 Thread Michael Chirico
I am curious why readLines() has a default (n=-1L) to read the full file while readChar() has no default for nchars= (i.e., readChar(file) is an error). Is there a technical reason for this? I often[1] see code like paste(readLines(f), collapse="\n") which would be better served by readChar(), esp

[Rd] Repeated library() of one package with different include.only= entries

2024-04-08 Thread Michael Chirico
Right now, attaching the same package with different include.only= has no effect: library(Matrix, include.only="fac2sparse") library(Matrix) ls("package:Matrix") # [1] "fac2sparse" ?library does not cover this case -- what is covered is the _loading_ behavior of repeated calls: > [library and re

Re: [Rd] [External] Re: Repeated library() of one package with different include.only= entries

2024-04-11 Thread Michael Chirico
I think your suggestion to just point to detach()+attachNamespace() is reasonable enough, the rare users that care about this are likely to be able to figure out the rest from there. On Thu, Apr 11, 2024 at 7:37 AM wrote: > On Thu, 11 Apr 2024, Duncan Murdoch wrote: > > &g

Re: [Rd] [External] Re: Repeated library() of one package with different include.only= entries

2024-04-15 Thread Michael Chirico
fruit. On Mon, Apr 15, 2024 at 6:46 AM Martin Maechler wrote: > I think we should try to advance and hopefully finalize this > thread before we forget about it .. > > >>>>> Michael Chirico n Thu, 11 Apr 2024 09:10:11 -0700 writes: > > >> I would assume

[Rd] Petition to set warnPartialMatch* options to TRUE during R CMD check by default

2024-04-22 Thread Michael Chirico
Hi all, What it says in the title. This is likely to cause a lot of CRAN packages to fail (I can try and quantify this if seen fit), but I think it's for the best. Packages should not (IMHO) be relying on partial matching in package code / tests. One might be more permissive for vignette/examples

Re: [Rd] numerical issue with t.test

2024-09-16 Thread Michael Dewey
Dear Toby I see no problem there. If you compute the mean and variance of err1 - err2 which is what the paired test is working on then that might help to see what is going on. Michael On 16/09/2024 15:47, Toby Hocking wrote: Hi! I expected that t.test should report a very large p-value

[Rd] stats::convolve documentation enhancement

2013-06-24 Thread Michael Moers
rnorm(1) system.time(convolve(x, y, type = "open")) # user system elapsed # 685.310.09 691.79 Thanks and Kind regards, Michael Moers [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] stats::convolve documentation enhancement

2013-06-25 Thread Michael Moers
have a better convolution function. Thanks and regards, Michael Am 24.06.2013 20:51, schrieb Hervé Pagès: Hi Michael, There are many issues with stats::convolve() that hopefully one day will be addressed. Full story here: https://stat.ethz.ch/pipermail/r-devel/2007-February/044529.html The

[Rd] probable bugs in stats::loglin calculation of pearson chisq

2013-07-09 Thread Michael Friendly
erstand the reasons for the different calculations of observed & expected for pearson & lrt. FWIW, below is how I calculate these in my mosaics.sas program start chisq(obs, fit); *-- Find Pearson and likelihood ratio chisquares; gf = sum ( (obs - fit)##2 / ( fit + (fit=0) ) );

[Rd] Confusion about Depends:, Imports:, Enhances:, import(), inportFrom()

2013-08-22 Thread Michael Friendly
: The ‘Imports’ field lists packages whose namespaces are imported from (as specified in the NAMESPACE file) but which do not need to be attached, but how can I tell if gnm needs to be attached? Also, what is the difference between Imports: in DESCRIPTION and imports() in NAMESPACE? -Micha

Re: [Rd] legitimate use of :::

2013-08-22 Thread Michael Friendly
functions to my package, but this seems wasteful. -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http:/

[Rd] packages with Sweave and knitr vignettes?

2013-08-23 Thread Michael Friendly
oes a package exist that does this? TIA -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca Toronto, ONT

Re: [Rd] [PATCH] show vector length in summary()

2013-09-10 Thread Michael Weylandt
On Sep 10, 2013, at 18:38, Simon Urbanek wrote: > > On Sep 10, 2013, at 12:56 PM, Sam Steingold wrote: > >>> * Dirk Eddelbuettel [2013-09-10 10:21:33 -0500]: >>> >>> On 10 September 2013 at 10:32, Sam Steingold wrote: >>> | (summary.default): show the vector length in addition to quantiles

[Rd] declaring package dependencies

2013-09-12 Thread Michael Friendly
ng messages: 1: package ‘vcd’ was built under R version 3.0.1 2: package ‘MASS’ was built under R version 3.0.1 > Note: these CRAN errors do not occur on R-Forge, using R version 3.0.1 Patched (2013-08-21 r63645) and the latest devel version (0.5-11) of vcdExtra. -Michael -- Michael Friendly

Re: [Rd] declaring package dependencies

2013-09-13 Thread Michael Friendly
ASS::loglm in examples seems ugly. For now, I'll use require(MASS) in each example. Attaching it first loads it, then modifies the user's search list so the user can see it. Which directive does this? -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology De

Re: [Rd] declaring package dependencies

2013-09-15 Thread Michael Friendly
nt a time machine or psychic powers, I do not see how package developers can reasonably be expected to cope with this. The effort by R Core members that goes into R and CRAN is certainly herculean and I appreciate it very much. Like Dirk, I'm just looking for a little more predictability

Re: [Rd] inconsistency/bug in recordPlot/replayPlot

2013-09-24 Thread Michael Weylandt
https://stat.ethz.ch/pipermail/r-devel/2013-September/067563.html Same instructions still apply -- this is a self-subscription list. M On Sep 24, 2013, at 0:42, Eric Malitz wrote: > take me off here > > > On Mon, Sep 23, 2013 at 10:31 PM, Gabriel Becker wrote: > >> Paul, >> >> Thanks for

[Rd] bug/infelicity in citation("base")

2013-10-04 Thread Michael Friendly
cite = citation(pkg, auto = if (pkg == "base") NULL else TRUE) entry = toBibtex(cite) entry[1] = sub("\\{,$", sprintf("{R-%s,", pkg), entry[1]) gsub("", "", entry) }, simplify = FALSE) Is th

[Rd] interrupting Sweave leaves open sink connection

2013-10-22 Thread Michael Sumner
;, "if (i %% 1000 == 0) print(sprintf(\"%i\", i))", "Sys.sleep(0.5)", "}", "@", "", "\\end{document}") f <- tempfile() writeLines(txt, f) Sweave(f) ## 2) ## now no printed output is seen print(1) ## sink(NULL) ## now i

Re: [Rd] advise on Depends

2013-10-25 Thread Michael Lawrence
s GenomicRanges objects. So just consider what the user sees when looking at your API. What's private, what's public? Michael > Comments? > > Best, > Kasper > > [[alternative HTML version deleted]] > > > ___

Re: [Rd] interrupting Sweave leaves open sink connection

2013-10-28 Thread Michael Sumner
Thanks very much, confirmed in Windows in R-patched (r64110) and R-devel (r64116). Cheers, Mike. On Wed, Oct 23, 2013 at 10:48 PM, Duncan Murdoch wrote: > On 13-10-22 10:45 PM, Duncan Murdoch wrote: >> >> On 13-10-22 9:45 PM, Michael Sumner wrote: >>> >>> Hello,

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

2013-11-03 Thread Michael Kane
I'd like to echo Whit's sentiment and hopefully warm up this thread. C++11's new features and functionality give R users low-level tools (like threads, mutexes, futures, date-time, and atomic types) that work across platforms and wouldn't require other external libraries like boost. Romain, will y

[Rd] proposal: stats::as.matrix.ftable method

2014-01-10 Thread Michael Friendly
31 244 E53 138 94 299 F22 351 24 317 > -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice:

[Rd] getting environment from "top" promise

2014-02-11 Thread Michael Lawrence
- nrow(ans@df) ans }) b <- new("B", df=mtcars) dropLowMpg(b) Would this be a useful addition to R? Is there a better way to solve this issue? We're using this successfully in the IRanges package now, but we'd like to avoid dealing with the internal details of R, and this is something that could be of general benefit. Thanks, Michael [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] FastR

2014-02-12 Thread Michael Haupt
like to point the R developers to the FastR project page, now on BitBucket: https://bitbucket.org/allr. The project mailing list is at https://groups.yahoo.com/neo/groups/fastr/info. Best regards, Michael Haupt -- Dr. Michael Haupt Principal Member of Technical Staff Phone: +49 331 200 7277

Re: [Rd] FastR

2014-02-13 Thread Michael Haupt
ading to much better performance. When built from the BitBucket repository, the default execution model is #2. > So you moved from github (https://github.com/allr/fastr) to BitBucket ? Yes, as the internal infrastructure we're using is 100 % Mercurial. Best regards, Michael Haupt -- D

[Rd] vignettes with similar names

2014-02-27 Thread Michael Sumner
In R 3.0.2 Patched (2014-01-31 r64905) and 3.0.3 beta (2014-02-25 r65077) I see a problem loading vignettes when I create a package with two vignettes with similar names, e.g. "vignette3" "vignette3-install" These seem not to be distinguished, and I get this vignette("vignette3") vignette ‘vigne

[Rd] forking a CRAN project

2014-03-04 Thread Michael Friendly
rily need to release my version to CRAN; just a public repo a reader could download from. -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Kee

Re: [Rd] How to import S3 method

2014-03-05 Thread Michael Weylandt
On Mar 4, 2014, at 10:21, "Wang, Zhu" wrote: > Dear Helpers, > > I wanted to import an S3 method from package glmnet to my own R package. > Specifically, I tried the following: > > plot.glmreg=function(x, xvar=c("norm","lambda","dev"),label=FALSE,shade=TRUE, > ...) UseMethod("glmnet") > >

[Rd] version numbers for CRAN submissions that give warnings/notes

2014-03-06 Thread Michael Friendly
even for a minor warning or note. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele StreetWeb: http://www.datavis.ca Toronto, ONT M3J 1

Re: [Rd] Maintainer NOTE in R CMD Check

2014-03-08 Thread Michael Sumner
I believe it's just a flag to notify that the author string has changed. You might need to send a confirmation email that yes you did mean to change, it is just a double check for both ends. I changed my email for a package once for some reason and made the confirmation. Cheers, Mike On 9 Mar 2014

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

2014-03-19 Thread Michael Weylandt
ough in your eyes? Is it the lack of CRAN provided binaries or the fact that the user has to proactively set up their environment to replicate that of published results? In your XML example, it seems the problem was that the reproducer didn't check that the same package versions as the

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

2014-03-19 Thread Michael Weylandt
On Mar 19, 2014, at 22:17, Gavin Simpson wrote: > Michael, > > I think the issue is that Jeroen wants to take that responsibility out > of the hands of the person trying to reproduce a work. If it used R > 3.0.x and packages A, B and C then it would be trivial to to install &g

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

2014-03-19 Thread Michael Weylandt
On Mar 19, 2014, at 22:45, Jeroen Ooms wrote: > On Wed, Mar 19, 2014 at 6:55 PM, Michael Weylandt > wrote: >> Reading this thread again, is it a fair summary of your position to say >> "reproducibility by default is more important than giving users access to >

Re: [Rd] The case for freezing CRAN

2014-03-20 Thread Michael Weylandt
trong assertion. What is the evidence for it? If I've understood Jeroen correctly, his point might be alternatively phrased as "won't be reproducED" (i.e., end user difficulties, not software availability). Michael __ R-devel@r-

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

2014-03-26 Thread Michael Lawrence
has a more creative solution, but any sort of conditional/dynamic approach would probably be too problematic in comparison. Michael On Wed, Mar 26, 2014 at 4:26 AM, Ulrich Bodenhofer wrote: > [cross-posted to R-devel and bioc-devel] > > Hi, > > I am trying to implement a 's

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] Unsubscribe me please

2014-04-17 Thread Michael Weylandt
On Apr 17, 2014, at 20:50, Mengsteab Aregay wrote: > I don't want to accept anymore emails from > https://stat.ethz.ch/mailman/listinfo/r-devel. can u please unsubscribed me. Read your own link. It has un-subscription instructions. > > Thanks you > >[[alternative HTML version deleted]]

[Rd] ReplayPlot, limited to single session for RecordPlot()

2014-04-30 Thread Michael Cohen
-- Michael Cohen Work: 808 Commonwealth Avenue, Actuarial Sciences, Boston Mass Home: 25 Stearns Road #3 Brookline, MA Ph: 1-857-389-3432(c) 1-617-758-5509(w) 617-734-8828(h) Fax: 617-353-7755 [[alternative HTML version deleted]] __ R-devel@r

[Rd] Request to Replace Recordplot ,, replayplot

2014-05-01 Thread Michael Cohen
be needed if one of the data formats already stored i.e. pdf ... etc. could be read in and used then as internal plot. Your thoughts --mike -- Michael Cohen Work: 808 Commonwealth Avenue, Actuarial Sciences, Boston Mass Home: 25 Stearns Road #3 Brookline, MA Ph: 1-857-389-3432(c) 1

Re: [Rd] Historical NA question

2014-05-04 Thread Michael Friendly
On 03/05/2014 12:39 PM, Hadley Wickham wrote: Can anyone tell me what the significance of 1954 is in R's NA? Just ask R: > 2*(1-pnorm(1954)) [1] 0 > 2*(1-pnorm(1954)) %in% NA [1] 0 > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailma

[Rd] historical significance of Pr(>Chisq) < 2.2e-16

2014-05-07 Thread Michael Friendly
5.2 1 < 2.2e-16 *** B:Age 1130.4 8 < 2.2e-16 *** W:Age 332.9 8 < 2.2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University

[Rd] Replay plot not allowed across sessions.

2014-05-10 Thread Michael Cohen
t using it after a load from the disk can lead to corruption of R. I would like to work on fixing this if it a fix is possible. Are there any posts about this? Who would know about this who might respond? --Best Mike -- Michael Cohen Work: 808 Commonwealth Avenue, Actuarial Scienc

[Rd] Writing my first CRAN vignette

2014-05-18 Thread Michael Dewey
separate .bib file? I am not envisaging doing anything complex: text, formulae, some tables and one figure plus a few references. Michael Dewey i...@aghmed.fsnet.co.uk http://www.aghmed.fsnet.co.uk/home.html __ R-devel@r-project.org mailing list https

Re: [Rd] Writing my first CRAN vignette

2014-05-19 Thread Michael Dewey
At 14:57 18/05/2014, Prof Brian Ripley wrote: On 18/05/2014 13:33, Michael Dewey wrote: In fact my first vignette full stop. I am intending to use Sweave. I have read the Sweave documentation and section 1.4 of the extensions manual and apart from (a) do not use split = TRUE (b) and include

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
1] "help" attr(,"origin") [1] "utils" Comments? Michael On Fri, Jun 27, 2014 at 8:32 PM, Yihui Xie wrote: > Hi Duncan, > > Again, thanks a lot for making this change (help requests are tried > over all loaded instead of attached packages): > https://git

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

2014-06-30 Thread Michael Lawrence
r perspective, promptImport() means that there is another man page to worry about, while exportFrom() would make it clear to developers reading the NAMESPACE that symbols are being simply forwarded, rather than re-defined. Michael On Sun, Jun 29, 2014 at 12:43 PM, Duncan Murdoch wrote: > On 29/

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] a question about optim.R and optim.c in R

2014-07-07 Thread Michael Weylandt
meters in an argument and passing that instead of passing them all as formals. One advantage of this is sane(er) handling of variadic functions at the C level. Michael > Thanks much!!! > > Best, > > Zhiyuan > >[[alternative HTML version deleted]] > >

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

2014-07-09 Thread Michael Lawrence
off point for a base4, an expanded stats4, or whatever. Michael On Sun, Jul 6, 2014 at 3:23 AM, Sven E. Templer wrote: > Dear developers, > > the implementation of S4 generics for existing S3 ones in the base > package is concerned to be a threat to quick startup times [1]. But > s

[Rd] cummax / cummin for complex numbers

2014-07-14 Thread Michael Haupt
7; not defined for complex numbers It may be fixed in R-devel, but I thought I'd mention it to make sure ... Best, Michael -- Dr. Michael Haupt Principal Member of Technical Staff Phone: +49 331 200 7277, Fax: +49 331 200 7561 Oracle Labs Oracle Deutschland B.V. & Co. KG, Schiffba

Re: [Rd] cummax / cummin for complex numbers

2014-07-14 Thread Michael Haupt
.. spot on. :-) Apologies for not having been more "pointy" about the problem - this just confirms it *is* kind of subtle. :-) Best, Michael Am 14.07.2014 um 17:18 schrieb Duncan Temple Lang : > I believe Michael's point is that the error messages > are incorrect - ref

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

2014-08-03 Thread Michael Friendly
rent S3 class scheme, but doesn't provide an extendible semantics. -Michael On 7/29/2014 11:20 PM, Adrian Baddeley wrote: Dear R developers A question about the class 'listof', defined in package 'stats'. Other than its definition and use in the code for '

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

[Rd] `*tmp*`

2014-08-14 Thread Michael Haupt
` Error: object '*tmp*' not found Confused greetings, Michael -- Dr. Michael Haupt Principal Member of Technical Staff Phone: +49 331 200 7277, Fax: +49 331 200 7561 Oracle Labs Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14, 14467 Potsdam, Germany _

Re: [Rd] `*tmp*`

2014-08-14 Thread Michael Haupt
tions because, in FastR, we're currently quite closely mirroring the AST interpreter's behaviour for complex assignments - if this is not an absolute must-have, I'd be very happy about being able to apply a much leaner implementation instead. Best, Michael -- Dr. Michael Haupt Princi

[Rd] no visible binding for global variable for data sets in a package

2014-08-26 Thread Michael Friendly
x27;Master' teamInfo: no visible binding for global variable 'Teams' One such function: ## function for accessing variable labels Label <- function(var, labels=rbind(battingLabels, pitchingLabels, fieldingLabels)) { wanted <- which(labels[,1]==var) if (length(wan

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Michael Friendly
On 8/27/2014 5:24 AM, Martin Maechler wrote: Michael Friendly on Tue, 26 Aug 2014 17:58:34 -0400 writes: > I'm updating the Lahman package of baseball statistics to the 2013 > release. In addition to > the main data sets, the package also contains sever

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Michael Friendly
On 8/27/2014 9:29 AM, Michael Friendly wrote: It works in the sense that Lahman::Label("yearID") will work even when Lahman is not in the search path, but R-devel CMD check will still give the same NOTE, though you can argue that that note is actally a "false positive"

Re: [Rd] no visible binding for global variable for data sets in a package

2014-08-27 Thread Michael Friendly
ction so they are de facto already in the namespace for the purposes of library() and `::`. So I agree, something like exportData() would be useful. (Or some other mechanism. You might want to be able to export data selectively.) - pd [*] "Burdened with pressing obligations", if y

[Rd] negative numerics in []

2014-09-04 Thread Michael Haupt
[1] -3 Good. But: > x <- c(1,2,3) > x[-3.1] [1] 1 2 3 Given the documentation, I'd have expected a result of "[1] 1 2", because -3.1 should be coerced to -3 (by virtue of as.integer). What bit do I not get? (I'm using R 3.1.1, if that matters.) Best, Michael --

[Rd] 'library' or 'require' call not declared from: 'rgl'

2014-10-30 Thread Michael Friendly
#x27;Creating R packages' of the 'Writing R Extensions' manual. How can I solve this? -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street

Re: [Rd] 'library' or 'require' call not declared from: 'rgl'

2014-10-30 Thread Michael Friendly
But R-devel now gave be all those "no visible global function definition for ..." messages. Achim suggested using explicitly rgl:: everywhere. That's quite ugly, but seems to work. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Q

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

[Rd] Using FPP preprocessor for Fortran Code

2014-11-30 Thread Michael Hahsler
fpp Is there a different preferred method to do this? Is it possible to add support for Fortran with the fpp preprocessor (.fpp files) to the R package building process? Thanks, Michael -- Michael Hahsler, Assistant Professor Department of Engineering Management, Information, and Syst

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
e and could be made fast. And I think binding objects would be useful in other ways, as they are essentially a "named object". For example, when iterating over an environment. Michael On Thu, Jan 8, 2015 at 6:03 AM, John Nolan wrote: > Adding an optional argument to ge

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] Programming Tools CTV

2015-01-23 Thread Michael Dewey
news about major changes. On the other hand since it is the programming tools CTV I imagine you will want to try out the latest all-singing, all-dancing technology. And why not. Michael On 23/01/2015 13:05, Christophe Dutang wrote: Dear Willem, Personally, I use the R-forge project for the

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
eck whether any arguments are S4 and if so, resort to recursion. Recursion does seem to be a clean way to implement "type promotion", i.e., to answer the question "which type should the result be when faced with mixed-type args?". Hopefully others have better ideas. Michael &g

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("s

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
Are you able to create a reproducible example, somehow? Thanks, Michael On Mon, Feb 9, 2015 at 2:28 PM, Mario Annau wrote: > Hi Michael, > I've tested your change in r67699 (using r67773) and the function now > correctly dispatches to r/cbind2 within the R-session without >

Re: [Rd] iterated lapply

2015-02-24 Thread Michael Weylandt
parallel::mclapply and friends? sapply(lapply(1:4, function(c){function(i){c*i}}), function(f) f(2)) # [1] 8 8 8 8 sapply(mclapply(1:4, function(c){function(i){c*i}}), function(f) f(2)) # [1] 6 8 6 8 I understand why they differ, but making mclapply easier for 'drop-in' parallelism might

Re: [Rd] iterated lapply

2015-02-25 Thread Michael Weylandt
...) >> />/}) >> />/ >> />/ which would produce the more desirable result >> />/ >> />/> sapply(test, function(myfn) myfn(2)) >> />/[1] 2 4 6 8 >> />/ >> / >> Would the same semantics be applied to para

<    1   2   3   4   5   6   7   >