Re: [Rd] MinGW and the ld bug

2006-02-14 Thread Henrik Bengtsson
) LIBRARY $ $*.def it works again. All the best, Henrik but that is not a general solution. On Mon, 13 Feb 2006, Henrik Bengtsson wrote: Hi. I noticed that Brian Ripley found and corrected a bug in MinGW's ld.exe, see http://www.murdoch-sutherland.com/Rtools/. Thanks for this. I

[Rd] file.info() on WinXP/NTFS 2Gb

2006-02-18 Thread Henrik Bengtsson
Hi, on WinXP Pro SP2 with NTFS, I noticed that file.info() under Rv2.2.1pat (2006-02-09) does not report the correct file size if the file is = 2^31 bytes (2GB). Is this problem known? Is this related to the note in ?file.info: Some (broken) systems allow files of more than 2Gb to be created

Re: [Rd] file.info() on WinXP/NTFS 2Gb

2006-02-18 Thread Henrik Bengtsson
On 2/18/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Sat, 18 Feb 2006, Henrik Bengtsson wrote: Hi, on WinXP Pro SP2 with NTFS, I noticed that file.info() under Rv2.2.1pat (2006-02-09) does not report the correct file size if the file is = 2^31 bytes (2GB). Is this problem known

Re: [Rd] Wishlist - Give R a name that shows up in search engines ...

2006-03-08 Thread Henrik Bengtsson
[[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Henrik Bengtsson Mobile: +46 708 909208 (+1h UTC) __ R-devel@r-project.org

[Rd] Can example() code stop the example without generating an error?

2006-03-14 Thread Henrik Bengtsson
Hi, does anyone know if it is possible to write example code (in Rd examples) such that one can stop the example without generating an error? Example: code A if (cond) niceStop() code B I know this sounds weird, but I would like some of my Rd examples to run if and only if another package is

[Rd] New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)

2006-03-14 Thread Henrik Bengtsson
On 3/14/06, Uwe Ligges [EMAIL PROTECTED] wrote: Henrik Bengtsson wrote: Hi, does anyone know if it is possible to write example code (in Rd examples) such that one can stop the example without generating an error? Example: code A if (cond) niceStop() code B What about

Re: [Rd] New simpleExit() condition (Was: Re: Can example() code stop the example without generating an error?)

2006-03-16 Thread Henrik Bengtsson
On 3/14/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: I would very much like to see such a feature too. On 3/14/06, Henrik Bengtsson [EMAIL PROTECTED] wrote: [snip] A nicer and more general solution is to have a subclass simpleExit of simpleCondition and make source() catch such signals

[Rd] How to set options() when a package without a name space is loaded?

2006-03-28 Thread Henrik Bengtsson
Hi, how do I set options() when loading a package *without* a name space? Is it possible? I though this one was a common question, but I could not find it in the FAQ, in the help nor in the r-help/r-devel archives. Section 1.6.3 on Load hooks in Writing R Extensions says that this should be

Re: [Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?

2006-03-29 Thread Henrik Bengtsson
On 29 Mar 2006 11:58:34 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: Henrik Bengtsson [EMAIL PROTECTED] writes: Hi, I've got the following two versions of R on WinXP: A) R Version 2.3.0 Under development (unstable) (2006-02-02 r37243) B) R Version 2.3.0 Under development (unstable

Re: [Rd] package?pac

2006-04-01 Thread Henrik Bengtsson
Reproducible example? To the best of my knowledge does 'type?topic' just bring up a help page; nothing is generated dynamically here. Example package?base. Are you thinking about how package Rd help pages are generated with promptPackage()? /Henrik On 3/31/06, Paul Gilbert [EMAIL PROTECTED]

Re: [Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
On 4/4/06, Thomas Lumley [EMAIL PROTECTED] wrote: On Tue, 4 Apr 2006, Henrik Bengtsson wrote: Hi, this relates to the question How to set a former environment? asked yesterday. What is the best way to to return a function with a minimal environment from a function? Here is a dummy

Re: [Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
to use :: as below: foo - function(huge) { mu - mean(huge) env - new.env(parent=baseenv()) assign(mu, mu, envir=env) bar - function(n) { stats::rnorm(n, mean=mu) } environment(bar) - env bar } /Henrik -roger Henrik Bengtsson wrote: Hi, this relates to the question How

Re: [Rd] Return function from function with minimal environment

2006-04-04 Thread Henrik Bengtsson
On 4/4/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 4/4/06, Henrik Bengtsson [EMAIL PROTECTED] wrote: On 4/4/06, Thomas Lumley [EMAIL PROTECTED] wrote: On Tue, 4 Apr 2006, Henrik Bengtsson wrote: Hi, this relates to the question How to set a former environment? asked

[Rd] predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())

2006-04-05 Thread Henrik Bengtsson
- smooth.spline(x=x, y=y) ypred - predict(sp$fit, x) # [1] 2.325181 2.756166 ... ypred2 - predict(sp$fit, c(0,x)) # Error in Recall(object, xrange) : couldn't find # function predict.smooth.spline.fit /Henrik On 4/5/06, Henrik Bengtsson [EMAIL PROTECTED] wrote: Hi, yesterday I got very useful

[Rd] Return function from function and Recall()

2006-04-05 Thread Henrik Bengtsson
Hi, yesterday I got very useful feedback on what is the best way to return a function from a function. Now, I run into a problem calling a returned function that down the stream uses Recall(). Below is a self-contained example. I took away yesterday's code for returning a minimal environment

[Rd] page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))

2006-04-05 Thread Henrik Bengtsson
the title. Then the ugly substitute() calls could be limited to one specific case; where a default object is passed and no title is set. If you want to, I could play around with a bit. /Henrik On 4/5/06, Kurt Hornik [EMAIL PROTECTED] wrote: Prof Brian Ripley writes: On Wed, 5 Apr 2006, Henrik

Re: [Rd] predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())

2006-04-05 Thread Henrik Bengtsson
On 4/5/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Wed, 5 Apr 2006, Henrik Bengtsson wrote: On 4/5/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Wed, 5 Apr 2006, Henrik Bengtsson wrote: Hi, forget about the below details. It is not related to the fact that the function

Re: [Rd] page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))

2006-04-05 Thread Henrik Bengtsson
On 4/5/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Wed, 5 Apr 2006, Henrik Bengtsson wrote: Here I think S3 dispatch is very natural. Try the following: I don't: it is documented to work on a name not an object. What comes first, the documentation of a method or the method itself

Re: [Rd] Run package code on R shutdown?

2006-04-10 Thread Henrik Bengtsson
be circumvented by quit(callLast=FALSE). /Henrik Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Henrik Bengtsson Mobile: +46 708 909208 (+2h UTC

Re: [Rd] Suggestions to speed up median() and has.na()

2006-04-11 Thread Henrik Bengtsson
On 4/11/06, Thomas Lumley [EMAIL PROTECTED] wrote: On Mon, 10 Apr 2006, Duncan Murdoch wrote: On 4/10/2006 7:22 PM, Thomas Lumley wrote: On Mon, 10 Apr 2006, Henrik Bengtsson wrote: Suggestion 2: Create a has.na(x) function to replace any(is.na(x)) that returns TRUE as soon as a NA

Re: [Rd] UseMethod infelicity

2006-05-22 Thread Henrik Bengtsson
On 5/20/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: Here are three examples where this matters, and I think the bug is elsewhere! 1) Package accuracy does ZeligHooks-function (...) { if (exists(.simHooked,envir=.GlobalEnv)) { return(TRUE) }

[Rd] save() saves extra stuff if object is not evaluated

2006-05-25 Thread Henrik Bengtsson
Hi, it looks like save() is saving all contents of the calling environments if the object to be saved is *not* evaluated, although it is not that simple either. After many hours of troubleshooting, I'm still confused. Here is a reproducible example (also attached) with output. I let the code

Re: [Rd] save() saves extra stuff if object is not evaluated

2006-05-25 Thread Henrik Bengtsson
On 5/25/06, Luke Tierney [EMAIL PROTECTED] wrote: On Thu, 25 May 2006, Henrik Bengtsson wrote: Hi, it looks like save() is saving all contents of the calling environments if the object to be saved is *not* evaluated, although it is not that simple either. No, it's exactly that simple

[Rd] FYI: R-2.3.1pat-win32.exe not on CRAN

2006-06-05 Thread Henrik Bengtsson
FYI, the download link on CRAN for R-2.3.1pat-win32.exe and related files seems to be broken at least since yesterday, e.g. http://cran.at.r-project.org/bin/windows/base/R-2.3.1pat-win32.exe. /Henrik __ R-devel@r-project.org mailing list

Re: [Rd] attributes of environments

2006-07-05 Thread Henrik Bengtsson
On 7/5/06, Thomas Lumley [EMAIL PROTECTED] wrote: On Wed, 5 Jul 2006, Gabor Grothendieck wrote: On 7/5/06, Thomas Lumley [EMAIL PROTECTED] wrote: On Wed, 5 Jul 2006, Gabor Grothendieck wrote: On 7/5/06, Thomas Lumley [EMAIL PROTECTED] wrote: On Tue, 4 Jul 2006, Gabor Grothendieck

[Rd] Fwd: Generating valid R code using R

2006-07-16 Thread Henrik Bengtsson
Sorry, this question was supposed to go to r-devel; move it there now. /HB -- Forwarded message -- From: Henrik Bengtsson [EMAIL PROTECTED] Date: Jul 16, 2006 11:11 AM Subject: Generating valid R code using R To: R-help r-help@stat.math.ethz.ch Hi, I'm trying to generate valid

Re: [Rd] png() and image()

2006-07-21 Thread Henrik Bengtsson
Wolfgang -- Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber Henrik Bengtsson wrote: Hi, I try to create PNG images of a certain size where each pixel intensity corresponds to exactly one probe signal

Re: [Rd] pari/gp interface

2006-07-25 Thread Henrik Bengtsson
On 7/25/06, Robin Hankin [EMAIL PROTECTED] wrote: Hi I'm developing an R package that needs to execute some code written in pari/gp. I've used this before from an R package (elliptic) but the interface is very basic: the R function creates a string such as the following: string - echo '

Re: [Rd] Package digest broken under R v2.4.0 devel

2006-07-28 Thread Henrik Bengtsson
to be done at the R level? Cheers Henrik On 7/27/06, Henrik Bengtsson [EMAIL PROTECTED] wrote: [cc:ing to the maintainer of digest] FYI, package 'digest' (v0.2.1 2005/11/04 04:45:53) generates the same output regardless of input with R v2.4.0 devel (2006-07-25 r38698). Starting a vanilla R

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

2013-08-22 Thread Henrik Bengtsson
On Thu, Aug 22, 2013 at 10:05 AM, R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com wrote: On Aug 22, 2013, at 9:09, Michael Friendly frien...@yorku.ca wrote: In checking my vcdExtra package, the following NOTE newly appeared (R-Forge, using R version 3.0.1 Patched

Re: [Rd] legitimate use of :::

2013-08-22 Thread Henrik Bengtsson
On Thu, Aug 22, 2013 at 2:03 PM, Hadley Wickham h.wick...@gmail.com wrote: To avoid the NOTEs (which often triggers a 'pls fix' upon submission to CRAN), I simply copied/pasted these functions to my package, but this seems wasteful. Wasteful of disk space, but disk space is cheap. It's less

Re: [Rd] packages with Sweave and knitr vignettes?

2013-08-23 Thread Henrik Bengtsson
On Fri, Aug 23, 2013 at 1:24 PM, Michael Friendly frien...@yorku.ca wrote: Now that R 3.0.0+ supports non-Sweave vignettes, R-exts \S 1.4.2 seems to imply that it is possible to include both Sweave and knitr vignettes in a single package. I'm wondering if anyone has tried this and/or if

Re: [Rd] Correct NAMESPACE approach when writing an S3 method for a generic in another package

2013-08-26 Thread Henrik Bengtsson
On Mon, Aug 26, 2013 at 1:28 AM, Martyn Plummer plumm...@iarc.fr wrote: I think rgl should be in Depends. You are providing a method for a generic function from another package. In order to use your method, you want the user to be able to call the generic function without scoping (i.e.

Re: [Rd] legitimate use of :::

2013-08-26 Thread Henrik Bengtsson
On Sat, Aug 24, 2013 at 9:46 AM, Kasper Daniel Hansen kasperdanielhan...@gmail.com wrote: On Thu, Aug 22, 2013 at 8:27 PM, Peter Meilstrup Using ::: on a package you don't control can be more dangerous. For a package author to choose to export a function to the public interface represents at

Re: [Rd] Error when using buildVignettes()

2013-08-28 Thread Henrik Bengtsson
sessionInfo() R version 3.0.0 Patched (2013-04-11 r62551) Platform: x86_64-apple-darwin10.8.0 (64-bit) I would check with R 3.0.1 patched and R devel before anything else, especially when troubleshooting vignette-related issues. /Henrik On Wed, Aug 28, 2013 at 12:33 PM, cstrato

Re: [Rd] Error when using buildVignettes()

2013-08-28 Thread Henrik Bengtsson
R 3.0.1, see: https://www.stat.math.ethz.ch/pipermail/bioconductor/2013-August/054633.html Best regards, Christian On 8/28/13 11:49 PM, Henrik Bengtsson wrote: sessionInfo() R version 3.0.0 Patched (2013-04-11 r62551) Platform: x86_64-apple-darwin10.8.0 (64-bit) I would check with R

[Rd] False warning on replacing previous import when re-exporting identical object

2013-08-29 Thread Henrik Bengtsson
Hi, SETUP: Consider three packages PkgA, PkgB and PkgC. PkgA defines a generic function foo() and exports it; export(foo) PkgB imports PkgA::foo() and re-exports it; importFrom(PkgA, foo) export(foo) PkgC imports everything from PkgA and PkgB: imports(PkgA, PkgB) PROBLEM: Loading or

Re: [Rd] Problem with texi2pdf(..,clean=TRUE)

2013-08-30 Thread Henrik Bengtsson
On Fri, Aug 30, 2013 at 12:14 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 30/08/2013 3:09 PM, Marc Schwartz wrote: On Aug 30, 2013, at 2:00 PM, cstrato cstr...@aon.at wrote: Dear all, To create a *.pdf file from a *.Rnw file I do: olddir - getwd();

Re: [Rd] Problem with texi2pdf(..,clean=TRUE)

2013-08-30 Thread Henrik Bengtsson
/30/13 9:36 PM, Henrik Bengtsson wrote: On Fri, Aug 30, 2013 at 12:21 PM, cstrato cstr...@aon.at wrote: Dear Duncan, dear Marc, Thank you for your fast reply. Can you please tell me: If texi2pdf() won't delete files how are the files deleted when the directory structure is Test/inst/doc

Re: [Rd] False warning on replacing previous import when re-exporting identical object

2013-08-30 Thread Henrik Bengtsson
On Fri, Aug 30, 2013 at 11:51 AM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: Hi. On Fri, Aug 30, 2013 at 6:58 AM, Paul Gilbert pgilbert...@gmail.com wrote: This is related to the recent thread on correct NAMESPACE approach when writing S3 methods. If your methods are S4 I think pkgB does

Re: [Rd] Problem with texi2pdf(..,clean=TRUE)

2013-08-30 Thread Henrik Bengtsson
On Fri, Aug 30, 2013 at 12:40 PM, Marc Schwartz marc_schwa...@me.com wrote: On Aug 30, 2013, at 2:20 PM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: On Fri, Aug 30, 2013 at 12:14 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 30/08/2013 3:09 PM, Marc Schwartz wrote: On Aug 30

Re: [Rd] Problem with texi2pdf(..,clean=TRUE)

2013-08-30 Thread Henrik Bengtsson
On Fri, Aug 30, 2013 at 12:21 PM, cstrato cstr...@aon.at wrote: Dear Duncan, dear Marc, Thank you for your fast reply. Can you please tell me: If texi2pdf() won't delete files how are the files deleted when the directory structure is Test/inst/doc/? Check if what you're observing is

Re: [Rd] False warning on replacing previous import when re-exporting identical object

2013-08-30 Thread Henrik Bengtsson
:::isGeneric(n, ns)) { ## warn only if generic overwrites a function which ## it was not derived from I'm planning to propose (wishlist / enhancement; it may even be a bug) this over at https://bugs.r-project.org/. Comments, anyone? /Henrik Paul Henrik

Re: [Rd] False warning on replacing previous import when re-exporting identical object

2013-09-09 Thread Henrik Bengtsson
Any intelligent comments on this before I submit a proposal/patch via bugs.r-project.org? /Henrik On Fri, Aug 30, 2013 at 12:47 PM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: On Fri, Aug 30, 2013 at 11:51 AM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: Hi. On Fri, Aug 30, 2013 at 6

[Rd] Is it possible to tell 'R CMD check' to accept certain filenames starting with a period?

2013-09-09 Thread Henrik Bengtsson
I a few of my packages I'd like to be able to add files starting with a period that installs with the package, e.g. inst/configs/.BatchJobs.R. Currently [R Under development (unstable) (2013-09-08 r63880)], R CMD check --as-cran complaints about this as: * checking for hidden files and

Re: [Rd] False warning on replacing previous import when re-exporting identical object

2013-09-12 Thread Henrik Bengtsson
Just for the record, I did submit PR#15451: 'Bug 15451 - PATCH: namespaceImportFrom() not to warn when the identical object is imported twice' on 2013-09-10 https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15451 /Henrik On Mon, Sep 9, 2013 at 2:37 PM, Henrik Bengtsson h...@biostat.ucsf.edu

Re: [Rd] Importing packages in Depend

2013-09-12 Thread Henrik Bengtsson
On Thu, Sep 12, 2013 at 6:49 AM, Benjamin Hofner benjamin.hof...@fau.de wrote: Hi, I am currently preparing a new version of my package papeR. When I run R CMD check using the development version of R I get the following note: Package in Depends field not imported from: ‘nlme’, ‘lme4’,

Re: [Rd] (no subject)

2013-09-21 Thread Henrik Bengtsson
another thread I'll close this one and reply/cc you there. /Henrik On Sat, Sep 21, 2013 at 9:44 AM, Ben Bolker bbol...@gmail.com wrote: Henrik Bengtsson hb at biostat.ucsf.edu writes: On Fri, Aug 30, 2013 at 11:51 AM, Henrik Bengtsson hb at biostat.ucsf.edu wrote: Hi. [snip] Bump

Re: [Rd] False warning on replacing previous import when re-exporting identical object

2013-09-21 Thread Henrik Bengtsson
On Sat, Sep 21, 2013 at 9:44 AM, Ben Bolker bbol...@gmail.com wrote: Henrik Bengtsson hb at biostat.ucsf.edu writes: On Fri, Aug 30, 2013 at 11:51 AM, Henrik Bengtsson hb at biostat.ucsf.edu wrote: Hi. [snip] Bump ... Henrik, did you ever post this as a request/wishlist at https

[Rd] recordPlot() on non-interactive graphics device?

2013-09-24 Thread Henrik Bengtsson
Hi. Q. Is there a way to record a plot using grDevices::recordPlot() without opening an interactive (=visible GUI window) graphics device (not even for a flash of a second)? Related: help(recordPlot, package=grDevices) says: These functions record and replay the displaylist of the current

Re: [Rd] recordPlot() on non-interactive graphics device?

2013-09-24 Thread Henrik Bengtsson
LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.0.1 On Tue, Sep 24, 2013 at 11:14 AM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: Hi. Q. Is there a way to record a plot using

Re: [Rd] how to interpose my own [ function?

2013-09-29 Thread Henrik Bengtsson
Typically you use NextMethod(), but otherwise you can either unclass your object first or use .subset(). Not sure from ?.subset whether that is ok to use or not. /Henrik On Sun, Sep 29, 2013 at 8:26 PM, Andrew Piskorski a...@piskorski.com wrote: I want to create my own [ function (for use on

Re: [Rd] read.table() with quoted integers

2013-09-30 Thread Henrik Bengtsson
On Mon, Sep 30, 2013 at 5:33 AM, Milan Bouchet-Valat nalimi...@club.fr wrote: Hi! It seems that read.table() in R 3.0.1 (Linux 64-bit) does not consider quoted integers as an acceptable value for columns for which colClasses=integer. But when colClasses is omitted, these columns are read as

Re: [Rd] read.table() with quoted integers

2013-10-04 Thread Henrik Bengtsson
On Fri, Oct 4, 2013 at 4:55 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-10-04 7:31 AM, Joshua Ulrich wrote: On Tue, Oct 1, 2013 at 11:29 AM, David Winsemius dwinsem...@comcast.net wrote: On Sep 30, 2013, at 6:38 AM, Joshua Ulrich wrote: On Mon, Sep 30, 2013 at 7:33 AM, Milan

Re: [Rd] read.table() with quoted integers

2013-10-04 Thread Henrik Bengtsson
On Fri, Oct 4, 2013 at 9:15 AM, peter dalgaard pda...@gmail.com wrote: On Oct 4, 2013, at 17:10 , Henrik Bengtsson wrote: On Fri, Oct 4, 2013 at 4:55 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-10-04 7:31 AM, Joshua Ulrich wrote: On Tue, Oct 1, 2013 at 11:29 AM, David

[Rd] http://r.research.att.com/ (daily R binaries for OSX) seems to be down

2013-10-08 Thread Henrik Bengtsson
It appears that http://r.research.att.com/, which provides daily builds of the R GUI, R-patched and R-devel for OSX, is down (at least since yesterday). I didn't find any contact information in online web caches, so I'm posting here in case the maintainer is listening. /Henrik

Re: [Rd] user defined macros in Rd files

2013-10-09 Thread Henrik Bengtsson
On Wed, Oct 9, 2013 at 2:04 PM, Yihui Xie x...@yihui.name wrote: I mean, it sounds like a better idea to define \CRANpkg only once in one central place, and use it in base R, instead of defining it in every single Rd file, because it seems to be generally useful (is 91 a large number? maybe).

Re: [Rd] install.packages() removes package on Windows

2013-10-10 Thread Henrik Bengtsson
My guess is that the DLL of the already installed XML package is loaded by another R session and that prevents the corresponding DLL file: path - system.file(libs, package=XML) list.files(path, recursive=TRUE, pattern=dll$) [1] i386/XML.dll x64/XML.dll from being deleted by install.packages()

Re: [Rd] user defined macros in Rd files

2013-10-13 Thread Henrik Bengtsson
On Sat, Oct 12, 2013 at 3:58 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-10-12 6:49 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: On Oct 9, 2013, at 21:18, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-10-09 7:54 PM, Henrik Bengtsson wrote: On my related

[Rd] Compatibility with R 2.15.x: Makefile for (non-Sweave) vignettes in vignettes/?

2013-10-13 Thread Henrik Bengtsson
In R 3.1.0 (~April 2014), support for vignettes in inst/doc/ will go away (and probably much sooner for CRAN submission), e.g. checking for old-style vignette sources ... NOTE Vignette sources only in ‘inst/doc’: ‘R.devices-overview.tex.rsp’ A ‘vignettes’ directory is required as from R 3.1.0 and

[Rd] reg.finalizer(): Is it safe for the finalizer function to attach/load a package?

2013-10-13 Thread Henrik Bengtsson
From the help/docs it is pretty clear that one could/should only assume that the 'base' namespace is available when a finalizer function is evaluated. What is not clear to me is whether you can safely attach/load packages in your finalizer function. For example, are the following finalizer

Re: [Rd] Compatibility with R 2.15.x: Makefile for (non-Sweave) vignettes in vignettes/?

2013-10-13 Thread Henrik Bengtsson
On Sun, Oct 13, 2013 at 9:51 PM, Jari Oksanen jari.oksa...@oulu.fi wrote: Henrik, On 14/10/2013, at 00:35 AM, Henrik Bengtsson wrote: In R 3.1.0 (~April 2014), support for vignettes in inst/doc/ will go away (and probably much sooner for CRAN submission), e.g. I've been sticking with inst

Re: [Rd] advise on Depends

2013-10-25 Thread Henrik Bengtsson
On Fri, Oct 25, 2013 at 1:39 PM, John Chambers j...@r-project.org wrote: One additional point to Michael's summary: The methods package itself should stay in Depends:, to be safe. There are a number of function calls to the methods package that may be included in generated methods for user

[Rd] on.exit() sys.on.exit(): Calling them via eval() does not work as hoped

2013-11-02 Thread Henrik Bengtsson
Why does the following eval() call on sys.on.exit() not return what I expect/evaluate in the proper environment? foo - function() { cat(foo()...\n); on.exit( message(exiting) ) cat(sys.on.exit():\n) res - sys.on.exit() print(res) cat(eval(sys.on.exit()):\n) expr -

Re: [Rd] Byte code compile not helpful in R3.0.2

2013-11-03 Thread Henrik Bengtsson
tfor - cmpfun(tfor) twhile - cmpfun(twhile) /Henrik On Sun, Nov 3, 2013 at 11:55 AM, Prof J C Nash (U30A) nas...@uottawa.ca wrote: My bad to not give details. I'm comparing (though not quite directly) to results in the posting http://rwiki.sciviews.org/doku.php?id=tips:rqcasestudy. What

Re: [Rd] on.exit() sys.on.exit(): Calling them via eval() does not work as hoped

2013-11-03 Thread Henrik Bengtsson
(print(exit 4)) cat(sys.on.exit():\n) x - sys.on.exit() print(x) cat(- exiting\n) } bar() [1] exit 2 sys.on.exit(): { print(exit 1) print(exit 3) print(exit 4) } - exiting [1] exit 1 [1] exit 3 [1] exit 4 On Sat, Nov 2, 2013 at 9:24 PM, Henrik

[Rd] WISHLIST: on.exit(..., add=TRUE, where=first) to address common use cases

2013-11-03 Thread Henrik Bengtsson
Before trying to submit a patch(*) to on.exit(), I'd like to check whether there is an interest in enhancing on.exit(..., add=TRUE) such that it is possible to specify whether the added expression should be added before or after already recorded expression. The default is now to add it after, but

[Rd] Milestone: 5000 packages on CRAN

2013-11-08 Thread Henrik Bengtsson
Here we go again... Today (2011-11-08) on The Comprehensive R Archive Network (CRAN) [1]: Currently, the CRAN package repository features 5001 available packages. Going from 4000 to 5000 packages took 14.5 months - that's one new package every 10.5 hours. Behind every package there are real

[Rd] SUGGESTION: Environment variable R_MAX_MC_CORES for maximum number of cores

2013-11-11 Thread Henrik Bengtsson
I like to propose a unified/standard system environment variable that specifies the maximum number of cores an R session should use, e.g. R_MAX_MC_CORES. This could then be used to *guide* multicore implementations on the number of cores to use. This is different from parallel::detectCores().

Re: [Rd] inflate zlib compressed data using base R or CRAN package?

2013-11-29 Thread Henrik Bengtsson
On Thu, Nov 28, 2013 at 4:48 PM, Simon Urbanek simon.urba...@r-project.org wrote: On Nov 27, 2013, at 8:30 PM, Murray Stokely mur...@stokely.org wrote: I think none of these examples describe a zlib compressed data block inside a binary file that the OP asked about, as all of your examples

[Rd] Proper way to drop 'srcref' from an expression created via substitute(function() ...)?

2013-12-12 Thread Henrik Bengtsson
First, why does this expression have a 'srcref' element: exprA - substitute(function(x) a*x, list(a=2)) print(exprA) function(x) 2 * x str(as.list(exprA)) List of 4 $ : symbol function $ :Dotted pair list of 1 ..$ x: symbol $ : language 2 * x $ :Class 'srcref' atomic [1:8] 1 20 1 34 20

Re: [Rd] Proper way to drop 'srcref' from an expression created via substitute(function() ...)?

2013-12-12 Thread Henrik Bengtsson
Thanks. /Henrik On Thu, Dec 12, 2013 at 5:27 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-12-12 7:57 PM, Henrik Bengtsson wrote: First, why does this expression have a 'srcref' element: exprA - substitute(function(x) a*x, list(a=2)) print(exprA) function(x) 2 * x str(as.list

[Rd] In-string variable/symbol substitution: What formats/syntax is out there?

2013-12-17 Thread Henrik Bengtsson
Hi, I'm try to collect a list of methods/packages available in R for doing in-string variable/symbol substitution, e.g. someFcn(pi=${pi}), anotherFcn(pi=@pi@) and so on becomes pi=3.141593. I am aware of the following: ** gsubfn() in the 'gsubfn' package, e.g. gsubfn( , , pi = $pi, 2pi =

[Rd] class() on substitute(...) output?

2014-01-02 Thread Henrik Bengtsson
Does it make sense to talk about the class of the output of substitute(...)? I'm puzzled by the following outputs: ee - list( A = substitute( a - 1 ), B = substitute({ a - 1 }), C = substitute(( a - 1 )), D = substitute( a == 1 ) ) t(sapply(ee, FUN=function(e) { c(typeof=typeof(e),

[Rd] file.info() on a file.symlink():ed file on Windows - is help correct?

2014-01-06 Thread Henrik Bengtsson
Is the following passage from help(file.info): Junction points and symbolic links are followed, so information is given about the file/directory to which the link points rather than about the link. correct? Could it be that Windows was not considered? help(file.symlink) mentions several

[Rd] Building R on Windows: mkdir of Rtools creates directories with read-only permissions [WEIRD]

2014-01-08 Thread Henrik Bengtsson
This is is an issue that bugged me for a while. I encountered a year ago (April 2012) when I first tried to build R from source on Windows. I never figured out what the solution is or if I'm doing something wrong myself (but I have found a tedious workaround). I'm still on the same Windows 7

Re: [Rd] file.exists does not like path names ending in /

2014-01-17 Thread Henrik Bengtsson
1. This is one of the reasons for isFile() and isDirectory() in R.utils. I add workarounds as new ones are discovered. 2. This works (and also tests for existence of a *directory*): file_test(-d, C:/Program Files) [1] TRUE file_test(-d, C:/Program Files/) [1] TRUE 3a. C: and C:/ (at the

Re: [Rd] package NAMESPACE question

2014-01-26 Thread Henrik Bengtsson
On Sun, Jan 26, 2014 at 6:34 AM, Axel Urbiz axel.ur...@gmail.com wrote: Hi Duncan, My most sincere apologies. It's really not my intention to waste anyones time. More the opposite...for some reason I thought that the problem had to do with my call to options() and thought that would be

[Rd] capture.output(): Using a rawConnection() [linear] instead of textConnection() [exponential]?

2014-02-03 Thread Henrik Bengtsson
I've noticed that the processing time for the default capture.output() grows exponentially in the number of characters outputted/captured. The default settings sinks to a temporary textConnection(). When instead sinking to a rawConnection(), the processing time becomes linear. See below example

[Rd] attach() outputs messages to stdout - should it be stderr?

2014-04-06 Thread Henrik Bengtsson
Contrary to other functions in 'base', attach() output messages to stdout instead of stdout, e.g. a - 1 capture.output(attach(list(a=1))) [1] The following object is masked _by_ .GlobalEnv: [2] [3] a Shouldn't this message go to stderr? Here's a patch for the local function

Re: [Rd] R 3.1.0: 'R CMD Sweave' deletes non tex files created upon batch mode exit

2014-04-14 Thread Henrik Bengtsson
Until fixed, one way to fool R here without changing the vignette or anything else seems to be (verified on Windows): mkdir figures set SWEAVE_OPTIONS=prefix.string=figures/fig R CMD Sweave foo.Rnw That obviously has some limitations. /Henrik On Mon, Apr 14, 2014 at 5:28 AM, Martin Maechler

Re: [Rd] The regular expressions in compareVersion()

2014-04-24 Thread Henrik Bengtsson
On Thu, Apr 24, 2014 at 1:42 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 24/04/2014, 1:11 PM, Yihui Xie wrote: Hi, I guess the backslash should not be used as the separator for strsplit() in compareVersion(), because the period in [.] is no longer a metacharacter (no need to

[Rd] Preventing $R_HOME/site-library/ via R_LIBS_SITE=: (no other way?)

2014-04-25 Thread Henrik Bengtsson
(As a non-root/non-admin), I've just tried to figure out how to prevent a default $R_HOME/site-library/ to be added to the library path. The solution I found was to environment variable R_LIBS_SITE to : (preferably in ~/.Renviron). Note that setting R_LIBS_SITE to en empty string will cause it

[Rd] Odd behavior on Windows: Rgui responds to user interrupts (Ctrl-C) at the Windows command prompt (iff launched from one)

2014-04-25 Thread Henrik Bengtsson
On Windows, 1. Open the Windows Command interpreter (cmd.exe). 2. Launch rgui.exe --vanilla. 2. In RGui, (disable Misc - Buffered output) and run the following endless loop: i - 0; repeat { print(i - i + 1); Sys.sleep(0.1) } [1] 1 [1] 2 [1] 3 ... 3a. Back at the Windows command line, press

[Rd] How to test if an object/argument is parse tree - without evaluating it?

2014-05-01 Thread Henrik Bengtsson
This may have been asked before, but is there an elegant way to check whether an variable/argument passed to a function is a parse tree for an (unevaluated) expression or not, *without* evaluating it if not? Currently, I do various rather ad hoc eval()+substitute() tricks for this that most

Re: [Rd] Request to Replace Recordplot ,, replayplot

2014-05-01 Thread Henrik Bengtsson
Hi, no need to repost and start yet another thread on the same topic as you posted yesterday (R-devel thread ''ReplayPlot, limited to single session for RecordPlot(), 2014-04-30). It just makes it hard to keep a constructive conversation in one place and it clutters up the archives. Replaying

Re: [Rd] How to test if an object/argument is parse tree - without evaluating it?

2014-05-02 Thread Henrik Bengtsson
is also what I hoped for, but specifically I wanted to test it on the 'expr0' object as in my example. Thanks, Henrik PS. Duncan, I was trying find a good name for it and got parse tree from ?substitute. -pd On 01 May 2014, at 22:39 , Henrik Bengtsson h...@biostat.ucsf.edu wrote: This may

Re: [Rd] R CMD check for the R code from vignettes

2014-05-30 Thread Henrik Bengtsson
I think there are several aspects to Yihue's post and some simple workarounds/long solutions to the issues: 1. For the reasons argued, I would agree that 'R CMD check' incorrectly assumes that tangled code script should be able to run without errors. Instead I think it should only check the

Re: [Rd] R CMD check for the R code from vignettes

2014-05-30 Thread Henrik Bengtsson
Sorry, it should be Yihui and nothing else. /Henrik On Fri, May 30, 2014 at 10:15 AM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: I think there are several aspects to Yihue's post and some simple workarounds/long solutions to the issues: 1. For the reasons argued, I would agree that 'R CMD

[Rd] PATCH: Avoiding extra copies (NAMED bumped) with source(..., print.eval=FALSE) ...and with print.eval=TRUE?

2014-06-17 Thread Henrik Bengtsson
OBJECTIVE: To update source(..., print.eval=FALSE) to not use withVisible() unless really needed. This avoids unnecessary increases of reference counts/NAMED introduced by withVisible(), which in turn avoids unnecessary memory allocations and garbage collection overhead. This has an impact on all

[Rd] debug()/trace() to standard error?

2014-06-24 Thread Henrik Bengtsson
Does anyone know of a simple/neat way to make debug() and/or trace() send output to the standard error stream (not standard output)? Thanks, Henrik __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Error in compactPDF/find_gs_cmd or documentation?

2014-07-14 Thread Henrik Bengtsson
Seems related to: https://stat.ethz.ch/pipermail/r-devel/2012-May/064213.html Henrik On Jul 14, 2014 10:45 AM, Jon Olav Skoien jon.sko...@jrc.ec.europa.eu wrote: I am using tools::compactPDF for reducing the size of some pdf-files with GhostScript. I had some trouble in the beginning as the

Re: [Rd] Re R CMD check checking in development version of R

2014-08-28 Thread Henrik Bengtsson
From a developers point of view, these days a less ambiguous name for 'Depends' would be 'Attaches'. ...or maybe even 'ImportsAndAttaches' with 'ImportsOnly' (for 'Imports'). I think Simon phrased it very well, and as others already pointed out, having one package attaching additional ones

Re: [Rd] negative numerics in []

2014-09-04 Thread Henrik Bengtsson
I can reproduce this. It seems to be happen when trying to drop the last element, e.g. x - 1:3 x[-3.1] [1] 1 2 3 x[-2.1] [1] 1 3 x[-1.1] [1] 2 3 x - 1:2 x[-2.1] [1] 1 2 x[-1.1] [1] 2 x - 1:4 x[-4.1] [1] 1 2 3 x[-3.1] [1] 1 2 4 x[-2.1] [1] 1 3 4 x[-1.1] [1] 2 3 4 x - 1 x[-1.1]

[Rd] format(object.size(...), units): KB, MB, and GB instead of Kb, Mb, and Gb?

2014-09-07 Thread Henrik Bengtsson
I cannot remember if this has already been discussed or not, and I'm a bit worried I'm throwing off an endless debate. If it's already settled, no need to discuss it further. TOPIC #1: Shouldn't R use KB, MB and GB when reporting on sizes kilobytes, megabytes and gigabytes? More specifically,

Re: [Rd] Shallow copies

2014-09-30 Thread Henrik Bengtsson
On Tue, Sep 30, 2014 at 2:20 PM, Matthieu Gomez gomez.matth...@gmail.com wrote: I have a question about shallow copies in R. Since R 3.1.0, subsetting a dataframe with respect to its columns no longer result in deep copies. This is an amazing change in my opinion. Now, subsetting a data.frame

[Rd] Any penalty for using gzfile() in place of file() for reading?

2014-10-03 Thread Henrik Bengtsson
A question I meant to ask for a very long time: I have several functions that temporarily open files using file(..., open=rb). I'd like to support gzip'ed files also and noticed that gzfile(..., open=rb) handles also non-compressed files, cf. help(gzfile): For 'gzfile' the description is the

[Rd] No error when assigning values to an empty vector/matrix/array

2014-10-23 Thread Henrik Bengtsson
Assigning one or more values to a vector/matrix/array x for which length(x) == 0 gives no error, e.g. x - integer(0) x[] - 1:2 x - matrix(nrow=0, ncol=1) x[] - 1:2 x[,1] - 1:2 x - array(dim=c(0,1,1)) x[] - 1:2 x[,1,1] - 1:2 whereas x - integer(1) x[] - 1:2 Warning message: In x[] -

Re: [Rd] No error when assigning values to an empty vector/matrix/array

2014-10-24 Thread Henrik Bengtsson
On Oct 24, 2014 1:59 AM, Hervé Pagès hpa...@fhcrc.org wrote: Hi Henrik, On 10/23/2014 08:10 PM, Henrik Bengtsson wrote: Assigning one or more values to a vector/matrix/array x for which length(x) == 0 gives no error, e.g. x - integer(0) x[] - 1:2 x - matrix(nrow=0, ncol=1) x[] - 1:2

Re: [Rd] proper use of reg.finalizer to close connections

2014-10-26 Thread Henrik Bengtsson
On Sun, Oct 26, 2014 at 8:14 PM, Murat Tasan mmu...@gmail.com wrote: Ah (again)! Even with my fumbling presentation of the issue, you gave me the hint that solved it, thanks! Yes, the reg.finalizer call needs to be wrapped in an .onLoad hook so it's not called once during package

<    1   2   3   4   5   6   7   8   9   10   >