On 10/16/07, Roger Peng [EMAIL PROTECTED] wrote:
My understanding was that Hadley wanted 'digest' to operate on part of
an object rather than on the entire, which might contain uninteresting
or irrelevant details. For example, if we had
a - structure(list(x = 1, y = 2), class = foo)
b -
So given the help file, we should consider dropping the whole
``along the boxplot'' idea?
{{well, yes, we should drop traditional graphics and work with
grid-based graphical objects (grobs) that can be drawn
vertically or horizontally,
e.g., in lattice or (most probably) ggplot2
}}
On 10/15/07, Henrik Bengtsson [EMAIL PROTECTED] wrote:
[As agreed, CC:ing r-devel since others might be interested in this as well.]
Hi.
On 10/15/07, Dirk Eddelbuettel [EMAIL PROTECTED] wrote:
Hi Hadley,
On 15 October 2007 at 09:51, hadley wickham wrote:
| Would you consider making
On 9/26/07, Herve Pages [EMAIL PROTECTED] wrote:
Hi Simon,
Simon Urbanek wrote:
Actually, the fact that the tar ball is there must be a mirroring
problem, because it's not on the master CRAN server. You should fix your
mirror - objects may appear closer ... ;)
Yesterday, before I
On 9/25/07, Simon Urbanek [EMAIL PROTECTED] wrote:
On Sep 25, 2007, at 12:58 PM, Herve Pages wrote:
Hi,
R-2.6 + install.packages() doesn't find rggobi on Mac OS X.
The .tgz file is here:
http://cran.fhcrc.org/bin/macosx/universal/contrib/2.6/
but it is not listed in the
On 9/25/07, Simon Urbanek [EMAIL PROTECTED] wrote:
On Sep 25, 2007, at 4:33 PM, hadley wickham wrote:
On 9/25/07, Simon Urbanek [EMAIL PROTECTED] wrote:
On Sep 25, 2007, at 12:58 PM, Herve Pages wrote:
Hi,
R-2.6 + install.packages() doesn't find rggobi on Mac OS X.
The .tgz file
3. temp - as.Date('1990/1/1') - as.date('1953/2/5')
sqrt(temp)
Error in Math.difftime(temp3) : sqrtnot defined for difftime objects
Minor bug: no space before the word 'not'
Major: this shouldn't fail.
Arguably, it should (Is this a difftime object? Which units?).
Hi all,
When installing ggplot2 on with install.packages(ggplot2, dep = T),
the colorspace dependency doesn't get installed (see below for
transcript from R session). The relevant lines from my description
file are:
Depends: R (= 2.4), grid, reshape (= 0.8.0), proto, splines, MASS,
What are you trying to defend against? A serious attacker could still
use rm/assign/get/eval/... to circumvent your replaced functions. I
think it would be very difficult (if not impossible) to prevent this
from happening), especially if the user can load packages.
Hadley
On 8/16/07, Michael
On 8/7/07, Duncan Murdoch [EMAIL PROTECTED] wrote:
Those are small parts of the calculation, not the whole thing. The
original point was that optim() is a very thin wrapper around the code
to do the optimization. I just don't see a need to make it more
complicated so it can be used to wrap
On 8/4/07, Duncan Murdoch [EMAIL PROTECTED] wrote:
On 04/08/2007 2:53 PM, Gabor Grothendieck wrote:
The example of generic functions.
Show me an example where we have a list of ways to do a calculation
passed as an argument (analogous to the method argument of optim), where
the user is
What's the recommended way to check if an internet connection is
available across platforms? I was using is.null(nsl()) but this does
not work on windows.
Thanks,
Hadley
__
R-devel@r-project.org mailing list
On 6/22/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Fri, 22 Jun 2007, hadley wickham wrote:
What's the recommended way to check if an internet connection is
available across platforms? I was using is.null(nsl()) but this does
not work on windows.
I don't know a way to do
On 5/22/07, Uwe Ligges [EMAIL PROTECTED] wrote:
Zack Weinberg wrote:
I have noticed that in R 2.5.0, no method of textual output will print
a double mode quantity with more than 15 digits after the decimal
point. From the help page (?print.default) it appears that this is
intentional,
On 5/23/07, hadley wickham [EMAIL PROTECTED] wrote:
On 5/22/07, Uwe Ligges [EMAIL PROTECTED] wrote:
Zack Weinberg wrote:
I have noticed that in R 2.5.0, no method of textual output will print
a double mode quantity with more than 15 digits after the decimal
point. From the help
On 5/23/07, Gabor Grothendieck [EMAIL PROTECTED] wrote:
On 5/23/07, Martin Maechler [EMAIL PROTECTED] wrote:
GaGr == Gabor Grothendieck [EMAIL PROTECTED]
on Wed, 23 May 2007 08:56:50 -0400 writes:
GaGr On 5/23/07, Seth Falcon [EMAIL PROTECTED] wrote:
Andrew Clausen [EMAIL
I think this is a bug in the MacOS X runtime. I've checked the C99
standard, and can see no limits on the precision that you should be able
to specify to printf.
That seems quite possible - it's interesting that increasing the
number of digits (ie 1e7 vs 1e6) doesn't crash, but takes up about
On 5/18/2007 11:11 AM, hadley wickham wrote:
On 5/18/07, Duncan Murdoch [EMAIL PROTECTED] wrote:
I think we've agreed about adding an option to the vignette() function
to allow the user to choose to see all vignettes in installed packages,
or only those that are attached. Adding
First, it was not clear that you are talking about the output of
traceback(), which is _a representation of_ the call stack and depends on
the details of deparsing.
Given that there is a substantial delay in one case, and not in the
other, I had assumed (perhaps falsely) that there was
On 5/13/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Sun, 13 May 2007, hadley wickham wrote:
First, it was not clear that you are talking about the output of
traceback(), which is _a representation of_ the call stack and depends on
the details of deparsing.
Given
Hi everyone,
I've run into a bit of strange problem with implicit vs explicit
printing and the call stack. I've included an example at the bottom of
this email. The basic problem is that I have an S3 object with a
print method. When the object is implicitly printed (ie. typed
directly into the
On 4/13/07, Roger Peng [EMAIL PROTECTED] wrote:
I've noticed something recently in R-beta that has changed since R 2.4.1
and I'm not sure if it's a readline problem or an R problem. I am on a
Linux FC5 system and in R 2.4.1 I could do
load(my-directory/
and then hit TAB and it would list
On 4/6/07, Stefan Theussl [EMAIL PROTECTED] wrote:
hadley wickham wrote:
I have recently found RForge.net (http://www.rforge.net/) by Simon
Urbanek and found out today that the site is accepting subscriptions.
Great! However, browsing a bit on the site I found a link to another
forge
On 3/26/07, José Luis Aznarte M. [EMAIL PROTECTED] wrote:
Hi! I've been browsing through the last months' archive and I can't
find an answer to my question, so here it is (let's hope it's not too
obvious):
I'm working on extensions of an R library, and I would be very
surprised if
On 3/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Quoting [EMAIL PROTECTED]:
In [.data.frame if you replace this:
...
if (is.character(i)) {
rows - attr(xx, row.names)
i - pmatch(i, rows, duplicates.ok = TRUE)
}
...
by this
...
You can use
if(require(myPackage)) { ... }
Yes, but the problem with this is that I now have the fact that this
function requires that package stated in two places - in the body of
the function, and in the examples - adding redundancy which makes
maintenance harder.
I guess what I really
On 2/24/07, Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Sat, 24 Feb 2007, hadley wickham wrote:
ggplot currently requires 13 packages (grid, reshape, RColorBrewer,
proto, splines, MASS, Hmisc, boot, butler, hexbin, mapproj, quantreg,
sm). Some of these are absolutely necessary (eg
/23/07, hadley wickham [EMAIL PROTECTED] wrote:
Dear all,
Another question related to my ggplot package: I have made some
substantial changes to the backend of my package so that plot objects
can now describe themselves much better. A consequence of this is
that a number of convenience
ggplot currently requires 13 packages (grid, reshape, RColorBrewer,
proto, splines, MASS, Hmisc, boot, butler, hexbin, mapproj, quantreg,
sm). Some of these are absolutely necessary (eg. proto), but most are
used for one or two specific tasks (eg. boot is only used to get
plogis, used
Dear all,
Another question related to my ggplot package: I have made some
substantial changes to the backend of my package so that plot objects
can now describe themselves much better. A consequence of this is
that a number of convenience functions that previously I wrote by
hand, can now be
On 2/23/07, Duncan Murdoch [EMAIL PROTECTED] wrote:
On 2/23/2007 11:05 AM, hadley wickham wrote:
Dear all,
Another question related to my ggplot package: I have made some
substantial changes to the backend of my package so that plot objects
can now describe themselves much better
Dear all,
ggplot currently requires 13 packages (grid, reshape, RColorBrewer,
proto, splines, MASS, Hmisc, boot, butler, hexbin, mapproj, quantreg,
sm). Some of these are absolutely necessary (eg. proto), but most are
used for one or two specific tasks (eg. boot is only used to get
plogis, used
What 'alphabetical order' is depends on the locale. In en_NZ g G, in C
G g. So it is a rather slippery concept (and gets worse in non-English
locales: 'aa' sorts after z in Danish).
I only used characters a-z, so I didn't think that would be a problem.
However, it turns out I had misnamed
Since you have not told us what 'the documents' are (and only vaguely
named one), do you not think your own documentation is inadequate?
There are documents about the condition system on developer.r-project.org:
please consult them.
Where exactly?
I tried:
* reading
Search for 'exception'. THe result points to
http://www.stat.uiowa.edu/~luke/R/exceptions/simpcond.html
Thanks Luke (and Brian). The note is entitled A Prototype of a
Condition System for R - can we assume the actual implementation is
as described?
Thanks,
Hadley
It's very particular:
Malformed Depends or Suggests or Imports or Enhances field.
Offending entries:
R (=2.4.0)
Entries must be names of packages optionally followed by '=' or '=',
white space, and a valid version number in parentheses.
^^^
You need a space after =
Hadley
OTOH, it's interesting that some methods to stick some S4
objects into a data frame do work fine , at least for the
following case (R-script below) -- and I wonder if we (R developers)
shouldn't think about more explicitly supporting this,
e.g., by stating something like
If an S4 object
- To execute R code contained in a string and return the result of this
evaluation in a string (including presentation of error messages and
warnings) exactly as if this was entered at the prompt. Duncan Murdoch
is against such a kind of function (he says a GUI should not substitute
to the R
See the .helpForCall function in utils. It would recognize that the
function was an S4 generic, and then work out the signature and look for
matching help. I think working out the signature in the case above
would require it to call lm(...). So there's a precedent for what I
called a huge
How can I suppress this warning?
options(warn = -10)
list(1,2,3,)
Warning: a final empty element has been omitted
the part of the args list of 'list' being evaluated was:
(1, 2, 3, )
[[1]]
[1] 1
[[2]]
[1] 2
[[3]]
[1] 3
suppressWarnings(list(1,))
Warning: a final empty element has been
R
version.string R version 2.4.0 beta (2006-09-20 r39433)
On 9/29/06, hadley wickham [EMAIL PROTECTED] wrote:
How can I suppress this warning?
options(warn = -10)
list(1,2,3,)
Warning: a final empty element has been omitted
the part of the args list of 'list' being evaluated was:
(1, 2
I think the spirit of Hadley's request could be handled by introducing a
declaration for S3 methods and by inserting S4-style alias{} lines into
their documentation. For example, if a function, say
setOldGeneric(summary), similar to setOldClass, informed the system that
summary was an S3
Yes, I agree that the current help system doesn't work very well on S3
methods. But I don't know how to fix it. I think the only way it could
know what to do on a construction like
?summary(lm(...))
would be to actually evaluate summary(lm(...)) (or maybe just lm(...)),
and I think that
You are supposed to do:
?summary.lm
?summary.data.frame
for S3 methods. The former works, the latter doesn't - which is
probably considered a bug, but then the usage of some of the
generics are probably considered obvious and fundamental enough
that summary.data.frame doesn't really
Well, I know that, and you know that, but how is anyone supposed to
figure it out? It means that you need to have a working knowledge of
the S3 and S4 class systems before you can use the help to reliably
get the documentation you need.
For S3 you do to understand that there are
But you also have to be able to identify if it is a S3 function or an
S4 method (or an ordinary function).
Why not just type ?summary, which as I said, does tell you up front?
If R can save the novice user a couple of steps in their search for
help, why not do it?
Getting documentation on
I do not follow this. When I type ?summary.data.frame I get a
summary help page where I can also find info about S3 method for class
'data.frame'. If I am not wrong it is
\alias{summary.data.frame}
that takes care of this.
Oops, summary.data.frame was a bad example, except perhaps to
Help for help says:
The 'topic' argument may also be a function call, to ask for
documentation on a corresponding method. See the section on
method documentation.
and
The authors of formal ('S4') methods can provide documentation on
specific methods, as well as
)
warning(Another warning.)
print(3)
}, warning = function(x) cat(x$message, \n))
)
print(out)
On 8/29/06, hadley wickham [EMAIL PROTECTED] wrote:
Is there any way to include warnings in the output from capture.output? eg:
a - capture.output(warning(test
It does look like it would be near-impossible to parameterise the logo
efficiently into a vector format - all that shading and 3-d effect
stuff.
These days, most vector graphics programs provide gradient shading
primitives - that's all you need to recreate most 3D effects.
Hadley
Is there any way to include warnings in the output from capture.output? eg:
a - capture.output(warning(test))
all.equal(a, Warning message: \n test )
Conceptually, this seems like redirecting stderr to stdout, or somehow
changing warning to simple print it's output. I've had a look at
tryCatch
Providing the ability to write assignment functions that don't duplicate
is a more urgent problem.
You mean, for end-users? It can be done via primitives.
Isn't this sort of a run-time optimisation? I thought R generally
followed the functional programming model of immutable objects, copy
data.frame()[]
NULL data frame with 0 rows
data.frame()[FALSE]
Warning in is.na(nm) : is.na() applied to non-(list or vector)
NULL data frame with 0 rows
data.frame()[NULL]
Warning in is.na(nm) : is.na() applied to non-(list or vector)
NULL data frame with 0 rows
Is this a bug? I wouldn't
Sorry, a better example is:
data.frame(a=1)[FALSE]
NULL data frame with 1 rows
data.frame(a=1)[NULL]
NULL data frame with 1 rows
vs
data.frame()[FALSE]
Warning in is.na(nm) : is.na() applied to non-(list or vector)
NULL data frame with 0 rows
data.frame()[NULL]
Warning in is.na(nm) :
I would like to take this:
.img(plot(1:10), filename=a)
and produce
plot(1:10)
ie. whenever .img is used, I want to take the first argument and throw
away everything else.
(I am trying to produce a Sweave like environment in which I can apply
certain functions, but not have them displayed in
I would like to take this:
.img(plot(1:10), filename=a)
and produce
plot(1:10)
Peter Dalgaard provided me with this:
f - function(e) {
if (!is.recursive(e)) e
else if (e[[1]] == quote(.img)) e[[2]]
else as.call(lapply(e, f))
}
f(quote({a-1;.img(abc,123)}))
{
a - 1
abc
}
which
I think it's bad to document dissimilar functions in the same file, but
similar related functions *should* be documented together. Not doing
this just adds to the burden of documenting them, and the risk of
modifying only part of the documentation so that it is inconsistent.
The user also gets
For me, it's been extremely helpful to keep function documentation
together during editing-- it greatly increases the chance that I will
actually update the doco when I change the code, rather than putting it
off until I've forgotten what I did. Also, writing Rd format is a
nightmare (again,
Hi Jeff,
I'd recommend you name it something you can google easily (ie. that
there are few (or no) hits currently from google). That way it's
really easy to tell people how to find the package/your webpage.
Hadley
On 6/15/06, Jeff Enos [EMAIL PROTECTED] wrote:
R-devel,
I'm in the process of
In the past I have been able to make windows packages (containing only
R code) from my mac by simply zipping the installed package directory,
eg.
R CMD install asmrsim
cd ~/Library/R/library/
zip -r9X asmrsim asmrsim
(using code copied from this list, from Duncan Murdoch, I think)
However,
Either the latter or ask the Windows users to install the source package.
Installing a source package doesn't seem to help:
install.packages(classifly, repos=http://ggobi.org/r/;, type=source)
Warning message:
installation of package 'classifly' had non-zero exit status in:
Dear all,
I have been working on an idempotent version of apply, such that
applying a function f(x) = x (ie. force) returns the same array (or a
permutation of it depending on the order of the margins):
a - array(1:27, c(2,3,4))
all.equal(a, iapply(a, 1, force))
all.equal(a, iapply(a, 1:2,
* checking S3 generic/method consistency ... WARNING
Warning: use of NULL environment is deprecated
Warning: use of NULL environment is deprecated
See section 'Generic functions and methods' of the 'Writing R Extensions'
manual.
I don't get any other warnings or errors. Can anyone suggest what
I don't get any other warnings or errors. Can anyone suggest what the
problem might be? (R2.3.0, OS X)
For reference: the problem was caused by having dependent packages
that been installed prior to R 2.3.0.
Hadley
__
R-devel@r-project.org mailing
It still segfaults even now that I've fixed the access error. Ah,
but if I specify type=source, so it must be a problem with having a
mac binary path but no packages in it. Is there anyway to fall back
to source automatically?
Thanks,
Hadley
On 5/9/06, hadley wickham [EMAIL PROTECTED] wrote
Patch attached.
If this is acceptable, would someone please be able to check this in for me?
Thanks,
Hadley
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
The rationale may be that a demo is entitled to assume it is being run
interactively. Checking demo(tkdensity), for example, would be
unproductive.
Also, it is easy for a package author to arrange to check the demos by a
test in the package's tests directory.
Thanks for your comments -
I was a bit suprised to note that demo files are not run as part of R
CMD check. This seems out of keeping with the philosophy of running
all code contained in the package (in the source, in examples etc).
Should demo files be checked as part of R CMD check?
Hadley
What is the policy for submitting packages that depend on external
non-R code? We'd like to add Rggobi2 to CRAN, but since the CRAN
machine won't have GGobi, I wanted to check what the policy/procedures
are.
Regards,
Hadley
__
R-devel@r-project.org
No, there's no automatic building after the promptPackage call. It's up
to you to decide which functions need to be mentioned to users. In
large packages it usually doesn't make sense to list all the functions,
so the package writer needs to use judgement here. There are other
mechanisms
Section 1.4 of Writing R Extensions says:
In addition to the help files in Rd format, R packages allow the
inclusion of documents in arbitrary other formats. The standard
location for these is subdirectory inst/doc of a source package, the
contents will be copied to subdirectory doc when the
Is there anyway to have my pdf documentation listed under vignettes
other than making it a sweave file?
No, a vignette is regarded as an Sweave file.
It would be useful if there was a mechanism to allow arbitrary pdf
files to be included as vignettes. There are many other ways to
include R
I think you need to define `vignette'. I understand the usage to mean an
Sweave file. There are ways to include other PDF files, and you can write
your own index file. R can't do that for you as it cannot read PDF (it
can read Sweave).
How can I write an index file with a pointer to my
We were referring to an HTML index file. If you want to have a
reference from your package man page (foo-package.Rd) or some other man
page, you can use \url{../doc/my.pdf} and the link will work in HTML
versions of help, and won't be too misleading in other versions
(especially if you
p.s. If my computations are correct, 0.2 = 0*/2 + 0/4 + 1/8 + 1/16 +
0/32 + 0/64 + 1/128 + 1/256 + 0/512 + 0/1024 + 1/2048 + 1/4096 + ... =
0.3h. Perhaps someone can extend this to an FAQ to help
explain finite precision arithmetic and rounding issues.
This is drifting a bit off
I'm trying to retrieve an unevalated argument (a list in particular).
I can do this easily when I call the function directly:
a1 - function(x) match.call()$x
a1(list(y=x^2))
list(y = x^2)
But when the function is called by another function, it gets trickier
b - function(x, f) f(x)
Thanks to Andy Liaw, I have realised my problem isn't getting an
unevaluated argument, my problem really is converting an unevaluted
list to list of unevaluted elements. That is, how can I go from
substitute(list(a=x, b=c))
to
list(a=substitute(x), b=substitute(c))
(I am also interested in a
| Michael Lawrence has as part of RGtk2.
Speaking of which -- I tried to find his code anywhere on the Internets
following his very nice DSC presentation, but no beans. Why is this in
hiding? Is it expected to surface at some point? Any insights, Duncan?
Michael is currently working on
actually, it might not be a bad idea to require a unique
bug-entry interface -- actually we have been thinking of moving
to bugzilla -- if only Peter Dalgaard could find a smart enough
person (even to be paid) who'd port all the old bug reports into the
new format..
If you haven't already it
I've also noticed the behaviour of grid.rect() has changed in 2.2.0.
Before the fill defaulted to transparent, but now it defaults to
white.
Hadley
On 10/21/05, Gabor Grothendieck [EMAIL PROTECTED] wrote:
The following:
library(grid)
grid.newpage()
example(Grid)
has the yaxis label
I'm not entirely sure what you want, but maybe this does the trick?
data.frame.by - function(data, variables, fun, ...) {
if (length(variables) == 0 ) {
df - data.frame(results = 0)
df$results - list(fun(data$value, ...))
return(df)
Thanks to all of you for your advice. I will read up on namespaces and
start using them to protect my internal function from name clashes
with other packages, and endeavour to my public functions unique
names.
I know other languages (eg. python) separate loading a package and
including it in the
701 - 782 of 782 matches
Mail list logo