Re: [Rd] [RE: why does parent.frame() cycle when called from inside capture.output()?]

2016-12-12 Thread Mark.Bravington
Hi Frederik Goodo, glad you found mvbutils::mvb.parent.frame useful. I had forgotten that it's in mvbutils rather than debug package. This all dates back about 15 years... To be fair, I don't think R's behaviour with duplicated-but-aliased frames in the call stack is a "bug"--- everything

Re: [Rd] Unexpected behavior of identical() with language objects

2014-10-29 Thread Mark.Bravington
[See below for full email trail-- Outlook has beaten me into submission] I ran into this and found the result very surprising: identical( quote({ a }), quote({ a }) ) # FALSE ... -Winston Yes, looks like srcrefs are to blame: x - quote({ a }) y - quote({ a }) identical(x, y) #

Re: [Rd] debuggingState() analogous to tracingState() ?

2014-10-02 Thread Mark.Bravington
Just FYI: the 'debug' package lets you set a stop-before-exit, and of course the ability to adjust breakpoints while the function is running. You can get the current return value via 'get.retval()'. There is some rough-edged support for debugging scripts, too. Mark Mark Bravington CSIRO CMIS

Re: [Rd] type.convert and doubles

2014-04-29 Thread Mark.Bravington
[...snip...] Martin Maecher wrote: I have now committed svn rev 65507 --- to R-devel only for now --- the above: exact = NA is the default and it means warning + FALSE. Interestingly, I currently get 5 identical warnings for one simple call, so there seems clearly room for

Re: [Rd] ':::' call

2013-08-28 Thread Mark.Bravington
Extracted from email trail below And as a potential user of your package, I don't want you to use ::: if you don't have control over the other package, because its author might unwittingly change it in a way that causes me to get incorrect results. If you want to use :::, go ahead,

[Rd] bug in help: R-devel pre 3.0

2013-01-28 Thread Mark.Bravington
G'day There's a bug in R-devel help() when something is documented in multiple places. Eg library( gmp) ?apply The browser window then contains: Error in length(packages):Help on topic '%s' was found in the following package: : NA/NaN argument Also, the *next* time 'help' or '?' is

Re: [Rd] tcltk freezing using MS Windows for R-2.14+

2012-12-18 Thread Mark.Bravington
Just a caveat about Sys.sleep() etc style fixes: I've had long-standing problems with tcltk on Windows in my 'debug' package-- i.e. for at least 7 years. The typical syndrome is that the debug window appears just as an empty frame, which has to be manually minimized/maximized/restored (or some

Re: [Rd] CRAN policies

2012-03-31 Thread Mark.Bravington
Herewith comments on some replies to my earlier post. To avoid burying my own points, I'll briefly restate my views (which may have evolved a bit): - We should not be concocting yet more complicated rules to solve imaginary problems; - RCMD CHECK should have (i) Notes, which are up to the

Re: [Rd] CRAN policies

2012-03-29 Thread Mark.Bravington
I'm concerned this thread is heading the wrong way, towards techno-fixes for imaginary problems. R package-building is already encumbered with a huge set of complicated rules, and more instructions/rules eg for metadata would make things worse not better. RCMD CHECK on the 'mvbutils' package

[Rd] parse( connection) and source-keeping

2012-01-11 Thread Mark.Bravington
In R = 2.13.x, calling 'parse( con)' where 'con' is a connection, 'options( keep.source)' is TRUE, and default 'srcfile' would preserve the source. In R = 2.14.1, it doesn't. tf - tempfile() options( keep.source=TRUE) texto - c( 'function() { # comment', '}') parse( text=texto)

[Rd] S4 summary method not being called (VGAM)

2012-01-09 Thread Mark.Bravington
The symptom triggering this email is that an S4 summary method sometimes refuses to be invoked, even when a package is explicitly loaded, if the first load of the package is implicit. It may or may not be specific to 'summary' methods and/or the 'VGAM' package. I've sent to R-devel because (i)

Re: [Rd] Finding inter-function dependencies within a package

2011-09-29 Thread Mark.Bravington
Hi Keith 'foodweb' and friends in the 'mvbutils' package should do what you're after. For example, I just tried this on the 'debug' package: ff - foodweb( where=asNamespace( 'debug')) # Now either just eyeball the dependency graph that 'foodweb' produces, or more formally: callers.of(

Re: [Rd] Please explain your workflow from R code - package - R code - package

2011-09-10 Thread Mark.Bravington
I create maintain all my packages using the 'mvbutils' package. Documentation in plain-text format (not Rd) is stored along with each function definition--- so when you edit your function, its doco is right there too, and it looks like proper documentation, not code-comments or quasi-Latex.

Re: [Rd] Overwriting imported function in another package

2011-08-08 Thread Mark.Bravington
[Jeroen Ooms wrote:] I am running into a limitation of the grid::grid.newpage function, for which I would like to overwrite this function with a slightly modified one. Hopefully this is a temporary working solution until the package gets updated. I found a way to overwrite the

Re: [Rd] Recent and upcoming changes to R-devel

2011-07-07 Thread Mark.Bravington
Thank you Duncan for those reassurances. I still have a couple of questions, as below, but there was definitely some good news for me in your replies: - IIUC , the source attribute will still be available for everything, provided R_KEEP_PKG_SOURCE=yes (I am not so worried about srcrefs) -

[Rd] Developing with Namespaces (was: Recent and upcoming changes to R-devel)

2011-07-07 Thread Mark.Bravington
Hi Kasper FWIW, the package development and maintenance support in 'mvbutils' makes it trivial to work with namespaced packages, even at the earliest stages of development. It's completely easy to add and remove functions to/from the namespace (and the exported visible bit) while the package

Re: [Rd] Recent and upcoming changes to R-devel

2011-07-04 Thread Mark.Bravington
I may have misunderstood, but: Please could we have an optional installation that does not *not* byte-compile base and recommended? Reason: it's not possible to debug byte-compiled code-- at least not with the 'debug' package, which is quite widely used. I quite often end up using 'mtrace'

Re: [Rd] Reproducible use case for R crash after updating R

2011-05-17 Thread Mark.Bravington
The ability to do a wounded load, when a proper load() can't be completed but you still want as much of the stuff as possible, would be very useful. In my experience, the trouble has invariably been a missing namespace, eg (as in Henrik's example) from a package that can't be found. That's OK

Re: [Rd] How to debug reference classes?

2011-04-07 Thread Mark.Bravington
'mtrace' will work with reference classes, at least after an object is instantiated. I'm not familiar with the guts of reference classes, but the following quick experiment was successful.. If you run the example in '?ReferenceClasses' up to including this line : xx - mEditor$new(data = xMat)

Re: [Rd] How to debug reference classes?

2011-04-07 Thread Mark.Bravington
Righto, thanks-- got it. When it comes to debugging, I'm no purist-- the 'debug' package has to work thru all sorts of undocumented features in R, so those of a sensitive disposition are advised _never_ to look at its internal code! Seems like the following works for mtracing refclass methods

Re: [Rd] a small suggestion for improving the building of packages

2010-09-16 Thread Mark.Bravington
FWIW, the package-building tools in the 'mvbutils' package-- see ?mvbutils.packaging.tools-- are supposed to alleviate much of this (provided of course you are willing to sign up to MY view of the universe...). Building a legal package out of existing code from scratch takes me less than 5

Re: [Rd] introspective capabilities

2010-09-01 Thread Mark.Bravington
Hi Christophe You could also look at the 'foodweb' function in package 'mvbutils'-- and specifically 'callers.of'. It should do just what you want, though you do have to tell it which environments to search through. bye Mark -- Mark Bravington CSIRO Mathematical Information Sciences Marine

Re: [Rd] RCMD CHECK and non-methods

2010-08-31 Thread Mark.Bravington
Thanks for those (very different!) responses. I was about to respond to Martin's question about doco amendments, when I saw Simon's reply. Case 1: If Martin completely prevails, then I guess the appropriate amendment to the documentation would be in R-extensions, section 1.3.1 Checking

[Rd] RCMD CHECK and non-methods

2010-08-24 Thread Mark.Bravington
I recently moved a function 'subset.with.warning' into the 'mvbutils' package (a version not yet on CRAN). When I tried RCMD CHECK, I got this warning: * checking S3 generic/method consistency ... WARNING subset: function(x, ...) subset.with.warning:

Re: [Rd] No RTFM?

2010-08-23 Thread Mark.Bravington
It seems as if the original point has been buried a bit here. So I'd just like to briefly agree with what Ted Harding said about guidelines, and then return to RTFM etc. The price paid for writing the best bit of software in the world, is that people want to use it. Some of those people will

[Rd] broken link to new features in R-devel: no NEWS file

2010-07-20 Thread Mark.Bravington
Hi The link from CRAN to new features in R-devel hasn't been working for a few days. Specifically, there is no NEWS file in https://svn.r-project.org/R/trunk/, though there is an ONEWS. The link is in the Source code for all platforms subwindow, where it says: Daily snapshots of current

Re: [Rd] R CMD check tells me 'no visible binding for globalvariable ', what does it mean?

2010-04-15 Thread Mark.Bravington
Speaking as a copious generator of CMD CHECK notes: I don't see that there's a problem to be solved here-- i.e. I don't see why it's worth changing good code or adding conventions just to circumvent CMD CHECK notes. (If the code is bad, of course it should be changed!) As the original poster

Re: [Rd] Best style to organize code, namespaces

2010-02-22 Thread Mark.Bravington
Ben-- FWIW my general take on this is: - Namespaces solve the collision issue. - Style 2 tends to make for unreadably long code inside Foo, unless the subfunctions are really short. - Style 3 is too hard to work with - So I usually use a variant on style 1: ### Style 4

Re: [Rd] parse_Rd and/or lazyload problem

2009-11-03 Thread Mark.Bravington
Sorry. What I thought you said was that you had spent several hours on it and didn't want to spend more time on it. I've told you I don't want to work on it either. If there is no way to trigger this bug without using internals, then it has not been demonstrated to be a bug in R. It

Re: [Rd] parse_Rd and/or lazyload problem

2009-11-01 Thread Mark.Bravington
Okay, then we both agree we should drop it. Duncan Murdoch No we don't. I can't provide a functioning mvbutils, or debug, until this is resolved. I am trying to be a good citizen and prepare reproducible bug reports-- e.g. the 3 line example. It would be quicker for me to write some ugly

Re: [Rd] parse_Rd and/or lazyload problem

2009-10-31 Thread Mark.Bravington
Does this happen in R-patched? I've seen similar errors in 2.10.0, but not in a current build. Yes, still there in R-patched. (Still haven't got to your code, this was in mine. I'm reluctant to spend time on code that is messing with internals, because you might be using things in a way

Re: [Rd] parse_Rd and/or lazyload problem

2009-10-30 Thread Mark.Bravington
The errors are generated inside lazyLoadDBfetch; I don't call object.size, so unfortunately that's not the issue (unless o.s. is called somewhere inside the .Primitive for lazyLoadDBfetch). I'm encountering problems when making lazy-loadable databases of the output from 'parse_Rd'. The

[Rd] parse_Rd and/or lazyload problem

2009-10-29 Thread Mark.Bravington
I'm encountering problems when making lazy-loadable databases of the output from 'parse_Rd'. The lazy-load database is of seemingly limitless size when I try to reload it... Admittedly I am using functions that I'm not really supposed to use, which is why this isn't a bug report, but there does

[Rd] Bug with .First in R 2.10

2009-10-18 Thread Mark.Bravington
Under R2.10.0 beta (2009-10-14 r50082) my .First does not run reliably. I reported this last week, but not reproducibly, and it seemed to go away, so I thought it might be installation-related. But it has now recurred reproducibly, at least on my machine. The website

Re: [Rd] Bug with .First in R 2.10

2009-10-18 Thread Mark.Bravington
I started the same version of R in my usual starting directory (where there's a larger .RData, whose .First is running OK right now) and then did save( .First, file=whatever) I'm not sure exactly where the .First came from before that; I use a couple of different machines and (in the runup to

[Rd] weird warning in [.data.frame with 2.10

2009-10-18 Thread Mark.Bravington
I'm getting the following warnings under 2.10 v50082 but not v49613 In addition: Warning messages: 1: In `[.data.frame`(df, -(1:nrow(df)), , drop = FALSE) : named arguments other than 'drop' are discouraged 5: In `[.data.frame`(object, !omit, , drop = FALSE) : named arguments other than

[Rd] post-installation startup problem with 2.10.0

2009-10-15 Thread Mark.Bravington
I've just installed R2.10.0 v50082, and found the problem described below the first few times I launched it. Did not occur with v49613 (the previous most recent version I have). The problem has now gone away, and is therefore non-reproducible, but there seems to be something up with parameter

Re: [Rd] Monkey patching +.POSIXt

2009-09-09 Thread Mark.Bravington
Hi Hadley This summer I've been working with a grad student to bring more of the date time classes from JODA (http://joda-time.sourceforge.net/) into R. To make these work seamlessly with existing date time objects, we need to patch +.POSIXt. (The ruby community uses the term monkey-patching

Re: [Rd] Monkey patching +.POSIXt

2009-09-09 Thread Mark.Bravington
Hmmm... 'assign.to.base( +.POSIXt, myfun)' works on my system (2.9.1 patched on Windows, at time of writing). Could be the 'mvbutils' version, I guess. What happened when you tried it? And what if you did 'getAnywhere( +.POSIXt)' afterwards? I was wrong about where '+.POSIXt' lives, though--

[Rd] internal and external debugging [was: [R] step by step debugger in R?]

2009-05-27 Thread Mark.Bravington
Hello all I'm coming late to this discussion, and my comments may now be beside the point-- but I have been intending to ask what people think of the pros cons of internal and external (e.g. 'debug' package) debuggers. When I wrote 'debug', the internal debugger just didn't do what I wanted,

[Rd] suggestion/request: install.packages and unnecessary file modifications

2009-03-10 Thread Mark.Bravington
Dear R-devel When 'install.packages' runs, it updates all html files in all packages. Mostly, there seems to be no actual change to the html file contents, but the date/time does change. This has causing been me a bit of trouble, because I keep synchronized versions of R on several different

Re: [Rd] question

2009-03-06 Thread Mark.Bravington
[ivo welch wrote:] The syntax for returning multiple arguments does not strike me as particularly appealing. would it not possible to allow syntax like: f= function() { return( rnorm(10), rnorm(20) ) } (a,d$b) = f() FWIW, my own solution is to define a multi-assign operator: '%-%' -

Re: [Rd] [Fwd: Re: [R] Randomly remove condition-selected rows from a matrix]

2009-01-02 Thread Mark.Bravington
This is a recurring problem and from previous correspondence it seems unlikely that sample itself will ever be changed (and having myself been on the wrong end of a number of non-back-compatible changes in R, that's fine with me!). To forestall future confusion, my suggestion is to add a

Re: [Rd] package development

2008-12-11 Thread Mark.Bravington
Hi Terry I suspect many people struggle with similar issues. The new version of mvbutils contains a number of routines that facilitate creation maintenance of a package, hopefully through its entire life-cycle: from documenting your own stuff for personal use, through giving out

Re: [Rd] Locating MiKTeX

2008-11-10 Thread Mark.Bravington
I've recently had a very similar experience to Spencer. The MikTex project page assumes you know what you want; I don't, so it seemed best to download the whole thing. Ouch. Would it be straightforward for Duncan Murdoch to add some brief instructions on what bit of MikTex to get to the

Re: [Rd] Two minor escaping issues using \preformatted{....} in Rd format

2008-11-06 Thread Mark.Bravington
Hi Peter I've recently run into very similar phenomena, not just in \preformatted. After extensive experimentation, I've found some ugly but effective workarounds. The Rd problems can occur *after* either a backslash or a left brace; that's a necessary but not sufficient condition, as they

Re: [Rd] changed behaviour of 'get' in 2.8.0: request for unchange

2008-10-24 Thread Mark.Bravington
Thanks both The other item that might have a relationship to this is the ability to a copy an object without evaluating it. This can't be done entirely in R but can be done in C code from R: http://tolstoy.newcastle.edu.au/R/e2/devel/07/09/.html For me, copying is even more important

[Rd] changed behaviour of 'get' in 2.8.0: request for unchange

2008-10-23 Thread Mark.Bravington
There is an unannounced and non-backwards-compatible change to the behaviour of 'get' in R2.8.0. 'get'ting a missing value now causes an error, whereas hitherto it's just returned a missing object. For example, in R2.8.0 this happens: test getto - function( x) get( 'x', sys.frame(1)) test

Re: [Rd] regexp with [:upper:] (PR#11032)

2008-03-24 Thread Mark.Bravington
Aaargh, sorry. I thought it might be to do with Australian English... Prof Brian Ripley wrote: That is correct: I suspect you meant the character class [[:upper:]] grep( '[[:upper:]]', letters, val=TRUE) character(0) You asked for matches amongst :upper:, and that is what you got. As

Re: [Rd] isOpen on closed connections

2007-11-15 Thread Mark.Bravington
I'd support a change, to having a closed-but-not-invalid status for a 'rw' connection, and to have a usable 'isOpen'. The suggestion of relying on user-code to always housekeep after calling 'close', eg by setting to NULL, seems a bit risky as a guideline for R as a whole (one can never tell what

[Rd] rbind.data.frame: bug?

2007-07-06 Thread Mark.Bravington
Consider the following, which is new behaviour under R 2.5+: df1 - data.frame( x=2, y='cat') df2 - data.frame( x=3, y='dog') rbind( df1[-1,], df2)$y == rbind( df1, df2)[-1,]$y Error in Ops.factor(rbind(df1[-1, ], df2)$y, rbind(df1, : Level sets of factors are different To me

[Rd] rbind.data.frame changes

2007-06-27 Thread Mark.Bravington
Dear R-devel Pre-2.5.0, 'rbind.data.frame(x,y,...)' would set the class of each column to be the class of that column in 'x'. This has changed now, because 'rbind.data.frame' first deletes any zero-row arguments; so if 'x' is a zero-row DF, the classes will be set to those in 'y'. This breaks my

Re: [Rd] Developer work cycle

2007-03-29 Thread Mark.Bravington
Couple of quick points: FYI1: the 'mtrace' function in the 'debug' package does let you trace hidden S3 methods (though it lacks the edit= argument). FYI2: In my own alpha-version of 'mvbutils', I am able to do live edits of code in (selected) installed packages, including adding deleting

Re: [Rd] substitute creates an object whichprints incorrectly (PR#9427)

2007-01-07 Thread Mark.Bravington
I think we should get rid of source attributes completely, since they are no longer needed, but your comment still applies to source references. We should strip them when code gets modified. Duncan Murdoch I would be very concerned about losing source attributes-- it would break a lot

Re: [Rd] Am I missing something about debugging?

2007-01-04 Thread Mark.Bravington
It is possible to do some of these things with the 'debug' package-- the article in R-news 2003 #3 shows a few of the tricks. Suppose 'b1' calls 'c1'. If 'c1' exists as permanent function defined outside 'b1' (which I generally prefer, for clarity), then you can call 'mtrace( c1)' and 'c1' will be

Re: [Rd] Am I missing something about debugging?

2007-01-04 Thread Mark.Bravington
Hi Ross Suppose 'b1' calls 'c1'. If 'c1' exists as permanent function defined outside 'b1' (which I generally prefer, for clarity), then you can call 'mtrace( c1)' and 'c1' will be invoked whenever it's called-- you don't have to first 'mtrace' 'b1' and then manually call

Re: [Rd] NAMESPACE Q: does import as exist?

2006-02-07 Thread Mark.Bravington
On 2/7/2006 8:48 PM, Seth Falcon wrote: Is there a way to rename a function when importing it? I want to say, import yourFunc from Foo as myFunc in the NAMESPACE file. I don't think Seth's facility exists yet, but it has occurred to me previously that it would be useful when you need

Re: [Rd] Problem installing from source: no CONTENTS files

2006-01-09 Thread Mark.Bravington
Brian D. Ripley, [EMAIL PROTECTED] This will only happen if you installed R without HTML help and then install a package *with* HTML help *and* do so into a non-standard directory. That seems an arcane thing to do: why do you want HTML help for some packages and not

[Rd] Problem installing from source: no CONTENTS files

2006-01-08 Thread Mark.Bravington
I've just had the error below while trying to install a package from source under R2.2.1 and Windows XP. I recall encountering this sporadically in the past. It is a pretty confusing message and took me quite some time to figure out; I've seen queries about it on the R site search, but couldn't

[Rd] sealed namespaces and lockEnvironment

2006-01-01 Thread Mark.Bravington
Dear R-devel I'm experimenting with easy-to-use ways for a package maintainer to modify alive package-- i.e. while it's loaded in use. One difficulty is that packages with namespaces are usually sealed with 'lockEnvironment', which means you can't add/remove objects. After some effort, I've

[Rd] Rd and guillemots

2005-09-15 Thread Mark.Bravington
First of all, thanks to those who've set up R to work so smoothly with Miktex-- even a total Latex bunny like me got it to work instantly, so that for the first time I'm able to run my Rd files through the Latex side of RCMD CHECK. Now the question/buglet. One of my Rd files contains the

[Rd] pos option to function 'library'

2005-08-31 Thread Mark.Bravington
At the moment, the 'pos' argument to 'library' defaults to 2. Would it be possible to change this default to something functionally like the following? pos= if( is.null( pos.expr - getOption( 'library.pos.default.expr'))) 2 else eval( pos.expr) The proposal is fully back-compatible in that 'pos'

[Rd] TCITex and R

2005-08-22 Thread Mark.Bravington
Several times my packages have fallen foul of the latex check at the uploading-to-CRAN stage, creating extra work for Kurt Hornik. I've never bothered trying to get latex working on my own packages (happy with vanilla help) but am told that latex is the closest thing to a syntax checker for Rd