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
[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)
#
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
[...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
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,
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
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
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
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
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)
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)
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(
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.
[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
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)
-
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
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'
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
'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)
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
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
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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--
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,
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
[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:
'%-%' -
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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'
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
63 matches
Mail list logo