[Rd] Load a package without installing it

2009-09-04 Thread Hadley Wickham
Hi all, When developing a package, it's often useful to be able to reload it, without re-installing, re-starting R and re-loading. To do this I've written a little script that inspects the package description and loads dependencies, data and code - http://gist.github.com/180883. It's obviously

Re: [Rd] Load a package without installing it

2009-09-04 Thread Hadley Wickham
Nice. I would guess many of us would have versions of this, it would be good to formalise it so that it could deal with : - namespaces, you might want your unexported functions to be separate from your exported functions. It looks like your function loads everything into .GlobalEnv - S4

[Rd] Package tests must have extension .R?

2009-09-04 Thread Hadley Wickham
Is this intentional? .r is accept most other places. Hadley -- http://had.co.nz/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] Package names

2009-09-03 Thread Hadley Wickham
Currently, writing R extensions states: The ‘Package’ and ‘Version’ fields give the name and the version of the package, respectively. The name should consist of letters, numbers, and the dot character and start with a letter. Now that _ is no longer an assignment operator, could it be added to

[Rd] clearNames and unname

2009-09-03 Thread Hadley Wickham
Just noticed these two functions (clearNames is stats and unname in base) that do the same thing. Hadley -- http://had.co.nz/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Package names

2009-09-03 Thread Hadley Wickham
Currently, writing R extensions states: The ‘Package’ and ‘Version’ fields give the name and the version of the package, respectively. The name should consist of letters, numbers, and the dot character and start with a letter. Now that _ is no longer an assignment operator, could it be

[Rd] Tracebacks try

2009-09-02 Thread Hadley Wickham
Hi all, The help for traceback states: Errors which are caught _via_ 'try' or 'tryCatch' do not generate a traceback, so what is printed is the call sequence for the last uncaught error, and not necessarily for the last error. Is there any way to get a traceback (or something similar) for

Re: [Rd] Documentation for is.atomic and is.recursive

2009-09-02 Thread hadley wickham
On Wed, Sep 2, 2009 at 1:54 PM, Stavros Macrakismacra...@alum.mit.edu wrote: On Wed, Sep 2, 2009 at 2:39 PM, Stavros Macrakismacra...@alum.mit.edu wrote: Most types of language objects are regarded as recursive: those which are not are the atomic vector types, 'NULL' and symbols (as

Re: [Rd] Checking package on Windows (and seemingly irreproducible errors in CRAN checks)

2009-07-28 Thread hadley wickham
On Tue, Jul 28, 2009 at 2:14 PM, Mathieu Ribatetmathieu.riba...@epfl.ch wrote: Dear Carlos, From your check results:        cbc.data - cbc.read.table( system.file(data,        cbc.test.data.txt, package = colbycol), sep = \t )                Warning in file(file, r) :                cannot

Re: [Rd] Roxygenating packages

2009-07-09 Thread hadley wickham
On Wed, Jul 8, 2009 at 6:13 PM, Barry Rowlingsonb.rowling...@lancaster.ac.uk wrote: On Wed, Jul 8, 2009 at 3:53 PM, hadley wickhamh.wick...@gmail.com wrote: Sounds like a neat idea!  Especially with Duncan Murdoch's recent work making it easy to parse rdoc files in R.  I reckon the tricky bit

Re: [Rd] Roxygenating packages

2009-07-08 Thread hadley wickham
Sounds like a neat idea! Especially with Duncan Murdoch's recent work making it easy to parse rdoc files in R. Hadley On Wed, Jul 8, 2009 at 1:07 PM, Barry Rowlingsonb.rowling...@lancaster.ac.uk wrote: Is there any interest in a method of taking a package with documentation in Rd files and

Re: [Rd] Changes to Rd handling in R-devel

2009-06-19 Thread hadley wickham
On Fri, Jun 19, 2009 at 6:12 PM, Duncan Murdochmurd...@stats.uwo.ca wrote: I've just committed some fairly big changes to R-devel.  - There's a new tag \Sexpr which allows R code to be embedded within the Rd file, similar to Sweave,  \RdOpts   corresponds to \SweaveOpts.  - The parser now

Re: [Rd] Colour Schemes

2009-05-21 Thread hadley wickham
 Yes, but these things are all at the wrong conceptual level. What you are constructing here is a function that maps value to colour, but keeping it as breaks and cut values and colours instead of representing it as a function. Wouldn't it be nicer to build a real function object and have

Re: [Rd] Qs: The list of arguments, wrapping functions...

2009-05-19 Thread hadley wickham
1. Is there a way for a function to refer generically to all its actual arguments as a list?  I'm thinking of something like the @_ array in Perl or the arguments variable in JavaScript.  (By actual I mean the ones that were actually passed, as opposed to its formal arguments, as returned by

Re: [Rd] proposed changes to RSiteSearch

2009-05-08 Thread hadley wickham
On Fri, May 8, 2009 at 10:11 AM, Romain Francois romain.franc...@dbmail.com wrote: strapply in package gsubfn brings elegance here: txt - 'foobar/foo' rx - (.*?)(.*?)/(.*?) strapply( txt, rx, c , perl = T ) [[1]] [1] foo bar foo Too bad you have to pay this on performance: txt - rep(

Re: [Rd] 'is.integer' (PR#13671)

2009-04-23 Thread hadley wickham
*However*, Mauricio submitted a *formal* bug report against R and there are many caveats against doing that light-heartedly. Note that he also said I know it's frustrating when people repeatedly ask this question (and file bug reports related to it), but does it really take that long to tell

Re: [Rd] Closed-source non-free ParallelR ?

2009-04-22 Thread hadley wickham
Also, I'm confused about your dimissal of the MCE example.  If that code was a derivative work of R, how could it swap a GPL license for the BSD?  I didn't think such a switch was possible.  If it was, I'd imagine a lot more use of it, as a quick front project could make GPL software into BSD

Re: [Rd] R CMD check dislikes .git directories

2009-04-21 Thread hadley wickham
Okay, that helps.  I don't think the problem is git versus svn, it's that you've got executable files in a directory where check shouldn't be looking.  I don't think .Rbuildignore would help you. I'll pass this on as a bug... I've complained about this in the past, and I was told that good

Re: [Rd] Why does the lexical analyzer drop comments ?

2009-03-31 Thread hadley wickham
At the moment, I am concentrating efforts deep down in the parser code, but there are other challenges: - once the expressions are parsed, we will need something that investigates to find evidence about function calls, to get an idea of where the function is defined (by the user, in a

Re: [Rd] what is the preferred method to create a package local variable?

2009-03-31 Thread hadley wickham
For saving the previous plot in ggplot2, I use the following: .plot_store - function() { .last_plot - NULL list( get = function() .last_plot, set = function(value) .last_plot - value ) } .store - .plot_store() set_last_plot - function(value) .store$set(value) last_plot -

Re: [Rd] R thread safe

2009-03-18 Thread hadley wickham
On Wed, Mar 18, 2009 at 9:11 AM, Ted Byers r.ted.by...@gmail.com wrote: On Wed, Mar 18, 2009 at 9:28 AM, Simon Urbanek simon.urba...@r-project.org wrote: Things cannot happen if you don't ask ... Cheers, Simon Then I have two questions. 1) What multicore package?  I didn't know there was

[Rd] Persistent data structures for R

2009-02-27 Thread hadley wickham
Hi all, Has anyone thought about developing persistent (http://en.wikipedia.org/wiki/Persistent_data_structure) functional data structures for R? A persistent data frame, for example, would seem like a possible way of drastically reducing memory consumption for many common problems. Would

Re: [Rd] Interactive Graphics in R [Was: Google Summer of Code 2009]

2009-02-19 Thread hadley wickham
What we need is a more general framework for interactive graphics - this requires more than just a graphics subsystem - you have to depart from the concept of graphics objects and include statistical objects in the mix such that the underlying data/statistics etc. can be identified by linking

Re: [Rd] Why is srcref of length 6 and not 4 ?

2009-02-12 Thread hadley wickham
I am using this to massage the output of parse into a data frame to represent it as a tree (see http://addictedtor.free.fr/misc/sidekick.png) You might also want to take a look at http://github.com/hadley/eval.with.details/blob/master/R/parse.r where I'm trying to do something similar for a

Re: [Rd] Capturing all warnings (with messages)

2009-02-04 Thread hadley wickham
Hi Jon, I have an in-development package that attempts to do this. It's called eval.with.details and is available from http://github.com/hadley/eval.with.details. As you might guess, it's a version of eval that captures all details like messages, warnings, errors and output so you can do

[Rd] Floating point excepting when cbind()ing a matrix of grobs (or environments) with a 0-column matrix

2009-01-19 Thread hadley wickham
library(grid) e - rectGrob() # OR: # e - environment() a - matrix(list(e), ncol = 1, nrow = 2) b - matrix(ncol = 0, nrow = 2) cbind(a, b) cbind(a, b) This reliably crashes R for me. I realise this is a rather esoteric error condition, but it crops up for me when creating matrices of grobs to

Re: [Rd] irrelevant warning message

2009-01-12 Thread hadley wickham
PS. Here are two interrelated reasons we don't autoconvert: 1. Subject id. Factors give no advantage for a unique id, and some clear problems. In particular when one creates as subset - everyone over 60 say - there is no good reason to remember all the ids you didn't select. 2. Subject

[Rd] Suggestions for improving R-FAQ

2008-11-25 Thread hadley wickham
Currently, if you were to print out the R frequently asked questions (http://cran.r-project.org/doc/FAQ/R-FAQ.html), it would be 132 pages long. Is it any wonder that so many question could be answered by looking at the FAQ but are not? Here are a few (contentious) suggestions to improve the

Re: [Rd] Suggestions for improving R-FAQ

2008-11-25 Thread hadley wickham
On Tue, Nov 25, 2008 at 12:41 PM, hadley wickham [EMAIL PROTECTED] wrote: Currently, if you were to print out the R frequently asked questions (http://cran.r-project.org/doc/FAQ/R-FAQ.html), it would be 132 pages long. Is it any wonder that so many question could be answered by looking

Re: [Rd] Suggestions for improving R-FAQ

2008-11-25 Thread hadley wickham
On Tue, Nov 25, 2008 at 3:10 PM, Max Kuhn [EMAIL PROTECTED] wrote: Hadley, These are good suggestions. * Remove infrequently asked questions - e.g. 2.3, 2.4, 7.9, 7.11, 7.12, 7.15, 7.19, 7.23, 7.28 Maybe 7.28 should be titled: How can I make read.table (and read.csv and read.fwf)) faster?

Re: [Rd] checking for executable files ... WARNING

2008-11-18 Thread hadley wickham
On Tue, Nov 18, 2008 at 1:31 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Mon, 17 Nov 2008, hadley wickham wrote: In R 2.8. I get the following warning when checking my package: * checking for executable files ... WARNING Found the following executable file(s): .git/objects/00

Re: [Rd] checking for executable files ... WARNING

2008-11-18 Thread hadley wickham
On Tue, Nov 18, 2008 at 7:00 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 18 Nov 2008, hadley wickham wrote: On Tue, Nov 18, 2008 at 1:31 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Mon, 17 Nov 2008, hadley wickham wrote: In R 2.8. I get the following warning when checking

[Rd] stringsAsFactors = FALSE

2008-11-17 Thread hadley wickham
Hi all, I love the option to not automatically convert strings into factors, but there are three places that the current option doesn't work where I think it should: options(stringsAsFactors = FALSE) str(expand.grid(letters)) str(type.convert(letters)) df -

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread hadley wickham
On Mon, Nov 17, 2008 at 11:06 AM, William Dunlap [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hadley wickham Sent: Monday, November 17, 2008 5:10 AM To: r-devel@r-project.org Subject: [Rd] stringsAsFactors = FALSE ... The key lines in expand.grid

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread hadley wickham
On Mon, Nov 17, 2008 at 9:03 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Mon, 17 Nov 2008, hadley wickham wrote: Hi all, I love the option to not automatically convert strings into factors, but there are three places that the current option doesn't work where I think it should

[Rd] checking for executable files ... WARNING

2008-11-17 Thread hadley wickham
In R 2.8. I get the following warning when checking my package: * checking for executable files ... WARNING Found the following executable file(s): .git/objects/00/12947a4bb4379fb0c3bed740314a9f4ac72331 .git/objects/00/21fac22a57a1567389ed34a9dc4f465c6cfd01

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
| is.matrix| returns |TRUE| if |x| is a matrix and has a |dim dim.html| attribute of length 2) and |FALSE| otherwise That's confusing! In what situations is x a matrix but does not have a dim attribute? Hadley -- http://had.co.nz/ __

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 1:35 PM, Daniel Høyer Iversen [EMAIL PROTECTED] wrote: That's confusing! In what situations is x a matrix but does not have a dim attribute? That was my point. I don't find it logical that is.matrix(a) gives FALSE but is.matrix(t( t(a) )) gives TRUE. I also think

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 1:42 PM, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: hadley wickham wrote: | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim dim.html| attribute of length 2) and |FALSE| otherwise That's confusing! In what situations is x a matrix but does not have a dim

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 1:58 PM, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: hadley wickham wrote: On Tue, Nov 11, 2008 at 1:42 PM, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: hadley wickham wrote: | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim dim.html| attribute of length 2

Re: [Rd] Thin spaces

2008-10-12 Thread hadley wickham
On Sun, Oct 12, 2008 at 1:01 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Sat, 11 Oct 2008, hadley wickham wrote: Hi all, I'm looking at providing some nicer number formatting features for axes in ggplot2. One thing I would like to do is use thin spaces to separate digits, like you

Re: [Rd] problem with cut.Date/date plotting in ggplot2

2008-10-11 Thread hadley wickham
Hi Ben, I think is a bug with cut.Date. I reported a similar bug (with days) a couple of weeks ago but no one responded. Hadley On Fri, Oct 10, 2008 at 9:15 PM, Ben Bolker [EMAIL PROTECTED] wrote: I've hit a problem in ggplot2 which I can trace back to cut.Date , which is either a bug or

[Rd] Thin spaces

2008-10-11 Thread hadley wickham
Hi all, I'm looking at providing some nicer number formatting features for axes in ggplot2. One thing I would like to do is use thin spaces to separate digits, like you can in latex. I realise I can use unicode spaces to do this (e.g. http://www.cs.tut.fi/~jkorpela/chars/spaces.html), but what

Re: [Rd] why is \alias{anRpackage} not mandatory?

2008-10-07 Thread hadley wickham
This shows up in the HTML help system. It would be better if it showed up in all help formats, but there are other ways to do that, e.g. creating an Rd help page pointing to those files. Or you can just link to them from your website. I don't think you'd argue with the statement that there's

Re: [Rd] why is \alias{anRpackage} not mandatory?

2008-10-07 Thread hadley wickham
I don't agree with this. Back in 2001 when this was first proposed it might have worked, but there's far too much inertia now to make a big change. Weren't you the one who objected to a requirement for a foo-package help topic? How would you like to rewrite all the help files for all of

Re: [Rd] why is \alias{anRpackage} not mandatory?

2008-10-06 Thread hadley wickham
- there are lots of packages without one, so this would create a lot of work for people to add them. No, I don't think that this is too much work. Positively speaking, it's one small contribution to bring more light into the exponentially growing haystack. It may not be much work for you,

Re: [Rd] why is \alias{anRpackage} not mandatory?

2008-10-06 Thread hadley wickham
You are right, .Rd has its limitations, but as you say, there is nothing better available in the moment. (BTW: I heard rumours at useR! about discussions on a meta documentation format? Is there any public information about this??) What do you mean by meta documentation format? Do you mean

Re: [Rd] why is \alias{anRpackage} not mandatory?

2008-10-06 Thread hadley wickham
It may not be much work for you, but I find any additional requirements to the package format to be a real pain. I have ~10 packages on CRAN and having to go through and add this extra information all at once is a big hassle. R releases tend to happen in the middle of the US academic

[Rd] R CMD install runs out of memory

2008-10-03 Thread hadley wickham
$ R CMD install ggplot2 ... scale-usage-d1texthtmllatex scale_brewer texthtmllatex example perl(90227) malloc: *** mmap(size=31488) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break

Re: [Rd] R CMD install runs out of memory

2008-10-03 Thread hadley wickham
On Fri, Oct 3, 2008 at 10:12 AM, Uwe Ligges [EMAIL PROTECTED] wrote: Duncan Murdoch wrote: On 10/3/2008 10:14 AM, hadley wickham wrote: $ R CMD install ggplot2 ... scale-usage-d1texthtmllatex scale_brewer texthtmllatex example

Re: [Rd] R --interactive and readline() creates infinite loop

2008-09-25 Thread hadley wickham
I assume, given this outcome, that this is not the intended use of --interactive, but I still wonder if there is any way to achieve an interactive session based on a predefined set of commands without writing a completely new front-end (overkill, surely?). When you say an interactive session,

[Rd] Cross-platform function availability

2008-09-15 Thread hadley wickham
Hi all, Is there any way to determine which functions are available on which platforms? For example, winProgr essBar (and related functions) are only available on Windows, but what about tkProgressBar and txtProgressBar? Is there any way to figure out which functions are only available on

Re: [Rd] Cross-platform function availability

2008-09-15 Thread hadley wickham
On Mon, Sep 15, 2008 at 12:06 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: On 9/15/2008 11:42 AM, hadley wickham wrote: Hi all, Is there any way to determine which functions are available on which platforms? For example, winProgr essBar (and related functions) are only available on Windows

[Rd] Bug in cut.Dates with single date and day breaks

2008-09-11 Thread hadley wickham
cut(as.Date(2008-09-12), days) Error in 1:(1 + max(which(breaks maxx))) : result would be too long a vector In addition: Warning message: In max(which(breaks maxx)) : no non-missing arguments to max; returning -Inf cut(as.Date(2008-09-12), weeks) [1] 2008-09-08 Levels: 2008-09-08

Re: [Rd] package signal, function filter (PR#12752)

2008-09-09 Thread hadley wickham
On Tue, Sep 9, 2008 at 2:30 AM, [EMAIL PROTECTED] wrote: Package 'signal' is not the responsibility of the R developers, so you need to follow the FAQ and report this to the maintainer, rather than clog up R-bgs with an inappopriate report. You might find that R's own function filter() is

Re: [Rd] lapply(NULL, ...) returns empty list

2008-09-04 Thread hadley wickham
On Thu, Sep 4, 2008 at 4:01 PM, Vadim Organovich [EMAIL PROTECTED] wrote: Dear R-devel, Is there a reason that lapply(NULL, ...) returns the empty list, rather than NULL? It seems intuitive to expect the latter, and rather counterintuitive that lapply(list(), ... ) returns the same value as

Re: [Rd] [R] embedded examples

2008-08-26 Thread hadley wickham
You might also want to look at existing visualisation applications that connect with R: * http://ggobi.org * http://rosuda.org/mondrian * http://rosuda.org/software/Gauguin/gauguin.html to name a few. Hadley On Tue, Aug 26, 2008 at 10:31 AM, EBo [EMAIL PROTECTED] wrote: I am working on

Re: [Rd] Posting Guide

2008-06-07 Thread hadley wickham
Here's my attempt at making a little more friendly: Removed self-contained - implied by reproducible Used slightly less formal language (and you instead of the questioner) Fixed a couple of spelling mistakes Removed references to testing framework - I don't think that that term needs to be

Re: [Rd] R CMD check: small tests suggestion

2008-05-04 Thread hadley wickham
It would be nice if R CMD check ran any file in the tests directory that has one of the extensions .R, .S, .q, .r, or .s - i.e. it should match the files processed in the R directory. Whereas what it is documented in 'Writing R Extensions' is to use .R or .Rin files. This leaves the

Re: [Rd] Out of bounds negative index

2008-05-02 Thread hadley wickham
On Fri, May 2, 2008 at 2:23 PM, Vincent Goulet [EMAIL PROTECTED] wrote: Hi, From the R Language Definition, Section 3.4.1: If i is positive and exceeds length(x) then the corresponding selection is NA. A negative out of bounds value for i causes an error. (This is also mentioned in S

[Rd] all.equal, classes, and order of arguments

2008-05-01 Thread hadley wickham
a - list() b - structure(list(), class=c(list, a)) all.equal(a, b) [1] Attributes: target is NULL, current is list all.equal(b, a) [1] Attributes: Modes: list, NULL [2] Attributes: names for target but not for current [3] Attributes: Length mismatch: comparison on first 0 components

Re: [Rd] Quotation marks (PR#11353)

2008-04-30 Thread hadley wickham
Single (') and double () quotation marks are not being read as quotation marks when commands are copied from Word; they produce an error message whenever they are used. To correct this, one has to retype everything in the R console. I tried using courier new, as well as the good old

Re: [Rd] RFC: What should ?foo do?

2008-04-25 Thread hadley wickham
But that's just a problem with the current implementation. Better indexing could make full text search of all documentation practical instantaneous. This is one argument for a centralised documentation web site - such indices are much easier to set up in a modern web development

Re: [Rd] RFC: What should ?foo do?

2008-04-25 Thread hadley wickham
On Fri, Apr 25, 2008 at 7:46 AM, Peter Dalgaard [EMAIL PROTECTED] wrote: Duncan Murdoch wrote: I haven't done it, but I suspect we could introduce special behaviour for ??foo very easily. We could even have a whole hierarchy: ?foo, ??foo, ???foo, foo, ... Heh, that's

Re: [Rd] RFC: What should ?foo do?

2008-04-25 Thread hadley wickham
I would rather see that be one of the dyadic forms, say site?foo or all?foo I'd be interested to know how many R users are aware of the dyadic form - I suspect it's very very few. Hadley -- http://had.co.nz/ __ R-devel@r-project.org

Re: [Rd] RFC: What should ?foo do?

2008-04-25 Thread hadley wickham
Consistent with this idea would be something like the I feel lucky search on Google, i.e. ?foo would go immediately to the best match, while ??foo would present a list of possible matches. This is not consistent with current behaviour, where ?foo will present a list if it matches two or more

Re: [Rd] RFC: What should ?foo do?

2008-04-25 Thread hadley wickham
It seems logical to me that such a resource be embedded up front in Intro with it also being included within the existing help system and referenced in the start up banner message. That would help if anyone actually read the startup banner. The next time you're in front of an audience of

Re: [Rd] RFC: What should ?foo do?

2008-04-24 Thread hadley wickham
I am not convinced that ?foo should do this however. help(foo) conceptually seems predicated upon the notion that a user is looking for a reference/help page for a specific function or descriptor called 'foo'. The user knows the name of the function or descriptor and should not have to

[Rd] __FILE__ for R

2008-04-04 Thread hadley wickham
I've often missed the ability to get the directory of the currently running script. It's actually been possible for a while: FILE - (function() { attr(body(sys.function()), srcfile) })() thanks to Duncan's recent changes to file parsing. This is pretty useful for sourcing in files relative

Re: [Rd] __FILE__ for R

2008-04-04 Thread hadley wickham
Sorry, that should be: FILE - (function() { attr(body(sys.function()), srcfile) })()$filename Hadley On Fri, Apr 4, 2008 at 10:34 AM, hadley wickham [EMAIL PROTECTED] wrote: I've often missed the ability to get the directory of the currently running script. It's actually been possible

[Rd] R CMD check should check date in description

2008-04-04 Thread hadley wickham
I'm always forgetting to update the date in DESCRIPTION. Would it be possible to add a warning to R CMD check if it's old? Hadley -- http://had.co.nz/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R CMD check should check date in description

2008-04-04 Thread hadley wickham
I recently thought about this. I see several issues. * How can we determine if it is old? Relative to the time when the package was uploaded to a repository? * Some developers might actually want a different date for a variety of reasons ... * What we currently say in R-exts is

Re: [Rd] R CMD check should check date in description

2008-04-04 Thread hadley wickham
Please no. If people want one then they should add it manually. It is optional, and some of us have explicitly opted out and would like to continue to do so. To clarify, do you mean you have decided not to provide a date field in the DESCRIPTION file? If so, would you mind elaborating why?

Re: [Rd] R CMD check should check date in description

2008-04-04 Thread hadley wickham
To clarify, do you mean you have decided not to provide a date field in the DESCRIPTION file? If so, would you mind elaborating why? Sure: The date of what? That's a good question. Another possible solution would be to remove (or down-weight the importance of) the date field, and

Re: [Rd] idea for GSoC: an R package for fitting Bayesian Hierarchical Models

2008-03-24 Thread hadley wickham
Ya. But speeds are rather different. I admittely missed a comparison with Umacs in my short demo. However, from some early experiments (I'm doing while I'm writing), as I suspected, my approach results being many times faster than Umacs, even if one doesn't specify samplers as C code.

Re: [Rd] Roxygen

2008-03-21 Thread hadley wickham
On Fri, Mar 21, 2008 at 11:36 AM, Duncan Murdoch [EMAIL PROTECTED] wrote: On 21/03/2008 2:09 AM, Peter Danenberg wrote: No, we want a solution in R. Would it suffice, by the way, to source() a file and introspect upon its objects with ls(), formals(), typeof(), mode(), and the like;

Re: [Rd] Roxygen

2008-03-19 Thread hadley wickham
On Wed, Mar 19, 2008 at 4:15 PM, Peter Danenberg [EMAIL PROTECTED] wrote: You should probably also survey existing attempts - I have written something with ruby that suggest some ideas. Fascinating, Hadley; do you have a link to the source, by any chance? It's completely local. I'll send

Re: [Rd] Roxygen

2008-03-18 Thread hadley wickham
On Mon, Mar 17, 2008 at 11:56 PM, Peter Danenberg [EMAIL PROTECTED] wrote: Is this the appropriate place for GSoC conversations? If I understand the proposal correctly, there should be a lexer (written in R) that exposes an API; that API would be used by segregated mini-parsers (Roclets)

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread hadley wickham
But what about when the new data is outside the range of the current plot? plot/lines/points already works that way so this is just an interface issue. That may be the way it is, but I don't see how you could argue that it's desirable behaviour. Hadley -- http://had.co.nz/

Re: [Rd] Aliasing a function

2008-02-26 Thread hadley wickham
)), lapply(argtrans, as.name) g2 function (d, e, f) f(a = d, b = e, c = f) f(1,2,3) a b c 1 2 3 g1(a=1,b=2,c=3) a b c 1 2 3 g2(d=1,e=2,f=3) a b c 1 2 3 -- Tony Plate hadley wickham wrote: On Sat, Feb 23, 2008 at 5:52 PM, Gabor Grothendieck [EMAIL

[Rd] Aliasing a function

2008-02-23 Thread hadley wickham
A simple way to alias a function is to do : g - function(a = 1, b = 2, c = 3) a + b * c f - function(...) g(...) but formals (etc) is no longer very helpful. Is there an easy way to programmatically create: f - function(a=1, b=2, c=3) g(a=a, b=b, c=c) This comes up in ggplot2 where I alias

Re: [Rd] Aliasing a function

2008-02-23 Thread hadley wickham
On Sat, Feb 23, 2008 at 5:52 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: I assume he wants to be able to change the formals although its confusing since the example uses the same formals in both cases. Yes, that was an important point that I forgot to mention! Thanks for the pointer to

Re: [Rd] 0.450.45 = TRUE (PR#10744)

2008-02-12 Thread hadley wickham
I'm thinking (by now quite strongly) that there is a place in Introduction to R (and maybe other basic documentation) for an account of arithmetic precision in R (and in digital computation generally). A section Arithmetic Precision in R near the beginning would alert people to this issue

Re: [Rd] a != a*1 != a+0 != +a

2008-02-04 Thread hadley wickham
One issue is the behaviour of unary operators + and -. If trim is TRUE, then a is one thing, but +a returns trim(a), which might be different. Also 1*a would be different from a and a+0 I think this is ok. In the ggplot2 package I use + to join together multiple plots, where a + b !=

Re: [Rd] A safe do.call

2008-01-30 Thread hadley wickham
hw That seems a perfectly good reason not to use ... - but hw if you are going to use ... it seems like you shouldn't hw warn on mismatched argument names. I disagree. One famous example on this was -- in S-plus, early 1990s -- known about S users back then, and it happened

Re: [Rd] A safe do.call

2008-01-29 Thread hadley wickham
Or is this a bug in glm? It certainly seems that the documentation should mention that ... is passed to glm.control, which only takes three arguments. I realise that this doesn't come up very often during an interactive model fitting session, and it is easy to remedy when it does, but

Re: [Rd] A safe do.call

2008-01-28 Thread hadley wickham
argument list. Hadley On Jan 28, 2008 8:19 PM, hadley wickham [EMAIL PROTECTED] wrote: Has anyone developed a version of do.call that is safe in the sense that it silently drops parameters that do not appear in the formals of the called function? This is useful when ... ends up being used

Re: [Rd] seekViewport error

2008-01-23 Thread hadley wickham
The problem (see also https://stat.ethz.ch/pipermail/r-help/2008-January/151655.html) is that cellGrobs (children of frame grobs) use their 'vp' component to store the viewport that positions them within the parent frame. This means that the viewport is pushed and then popped (as per normal

Re: [Rd] checking whether the name space can be loaded with stated dependencies

2008-01-08 Thread hadley wickham
On Jan 8, 2008 1:31 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: Hadley sent me the package, and my guess *was* correct. The package is not using lazy-loading, and early on it has (in aaa-top-level.r) TopLevel - proto(expr = { ... That is 'a top-level computation'. To make this work,

Re: [Rd] Unicode whitespace

2008-01-05 Thread hadley wickham
On Jan 5, 2008 1:40 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: I presume you want this only in a UTF-8 locale? Yes, although my assumption is that this will become an increasing common locale as time goes by. Currently this is done by static int SkipSpace(void) { int c;

[Rd] Unicode whitespace

2008-01-04 Thread hadley wickham
It would be nice if R ignored more unicode white space characters. For example, if I have \u2028 in a command (which I get from a line-break in keynote) I get the following error: qplot(carat, price, data = diamonds, 
 colour=clarity) Error: unexpected input in qplot(carat, price, data =

Re: [Rd] checking whether the name space can be loaded with stated dependencies

2008-01-04 Thread hadley wickham
On 1/4/08, Henrik Bengtsson [EMAIL PROTECTED] wrote: On 04/01/2008, hadley wickham [EMAIL PROTECTED] wrote: On 1/4/08, Prof Brian Ripley [EMAIL PROTECTED] wrote: What it is trying is % env R_DEFAULT_PACKAGES=NULL R loadNamespace(ggplot2) The test is not new, so it would

[Rd] checking whether the name space can be loaded with stated dependencies

2008-01-03 Thread hadley wickham
Can any one provide more details on this error that I'm getting from R CMD check: * checking whether the name space can be loaded with stated dependencies ... WARNING Error in eval(expr, envir, enclos) : could not find function proto Error: unable to load R code in package 'ggplot2' Execution

[Rd] available.packages() not accurate?

2007-12-18 Thread hadley wickham
pkgs - as.data.frame(available.packages(contrib.url(http://cran.r-project.org;))) pkgs[sn, c(Package, Version)] But looking at http://cran.r-project.org/src/contrib/ only sn_0.4-2 is available. Any ideas? Thanks, Hadley -- http://had.co.nz/ __

Re: [Rd] available.packages() not accurate?

2007-12-18 Thread hadley wickham
On 12/18/07, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 12/18/07, hadley wickham [EMAIL PROTECTED] wrote: pkgs - as.data.frame(available.packages(contrib.url(http://cran.r-project.org;))) pkgs[sn, c(Package, Version)] But looking at http://cran.r-project.org/src/contrib/ only

Re: [Rd] available.packages() not accurate?

2007-12-18 Thread hadley wickham
pkgs - as.data.frame(available.packages(contrib.url(http://cran.r-project.org;))) pkgs[c(sn, GOSim, GammaTest), c(Package, Version)] Package Version sn sn 0.4-4 GOSim GOSim 1.1.2 NA NANA which match CRAN (which doesn't have GammaTest). So not sure what's

Re: [Rd] Building packages

2007-12-07 Thread hadley wickham
On 12/7/07, Barry Rowlingson [EMAIL PROTECTED] wrote: Gabor Grothendieck wrote: An svn checkout directory can contain a mix of files that are mirrored in the svn and not mirrored. In particular, if you add a new file into your checkout directory it will not automatically go into the

Re: [Rd] Saving Graphics File as .ps or .pdf (PR#10403)

2007-11-06 Thread hadley wickham
(Ideally, people would try the prerelease versions and problems like this would be caught before the actual release, but it seems that they prefer treating x.y.0 as a beta release...) The one time I did do this and complained about a change (trailing commas now throw an error), no one

Re: [Rd] RSQLite indexing

2007-10-22 Thread hadley wickham
On 10/22/07, Thomas Lumley [EMAIL PROTECTED] wrote: I am trying to use RSQLite for storing data and I need to create indexes on two variables in the table. It appears from searching the web that the CREATE INDEX operation in SQLite is relatively slow for large files, and this has been my

[Rd] Underlying representation for rownames

2007-10-18 Thread hadley wickham
Is it possible to get at the underlying representation of row names - ie. what you see in the output from dput: df - data.frame(1:4) dput(df) structure(list(X1.4 = 1:4), .Names = X1.4, row.names = c(NA, -4L), class = data.frame) I would like to be able to tell if a data frame has the default

<    2   3   4   5   6   7   8   >