[Rd] interesting connection / finalizer bug?

2012-01-06 Thread Martin Morgan
This setOldClass(c(file, connection)) .A - setRefClass(A, fields=list(con=connection), methods=list( finalize = function() { if (isOpen(con)) close(con) })) f - tempdir() a - .A$new(con=file(f, rb)) close(a$con) a

[Rd] seq_along and rep_along

2012-01-06 Thread Hadley Wickham
Hi all, A couple of ideas for improving seq_along: * It would be really useful to have a second argument dim: seq_along(mtcars, 1) seq_along(mtcars, 2) # equivalent to seq_len(dim(mtcars)[1]) seq_len(dim(mtcars)[2]) I often find myself wanting to iterate over the rows or

[Rd] R CMD check WARNING \usage question

2012-01-06 Thread Jeff Hamann
I'm trying to update a package and would like to crush a WARNING message for a clean build. I've been struggling with this question and haven't gotten any traction on the web either. I've got a document file (Rd) that contains the following \usage statement: \name{sample.data}

Re: [Rd] delete.response leaves response in attribute dataClasses

2012-01-06 Thread Paul Johnson
Thanks, Bill Counter-arguments at the end On Thu, Jan 5, 2012 at 3:15 PM, William Dunlap wdun...@tibco.com wrote: My feeling that everyone would index dataClasses by name was wrong.  I looked through the packages that used dataClasses and saw code that would break if the first (response)

Re: [Rd] seq_along and rep_along

2012-01-06 Thread Duncan Murdoch
On 12-01-06 1:31 PM, Hadley Wickham wrote: Hi all, A couple of ideas for improving seq_along: * It would be really useful to have a second argument dim: seq_along(mtcars, 1) seq_along(mtcars, 2) # equivalent to seq_len(dim(mtcars)[1]) seq_len(dim(mtcars)[2]) I

Re: [Rd] R CMD check WARNING \usage question

2012-01-06 Thread Jeff Hamann
I know I should provide a better answer, but I think it's really for a function. For this package, we simply pass a list object about, but have to obfuscate it using a domain familiar nomenclature for the users. So, not a data set, but a function. I think. Here's the file in it's entirety:

Re: [Rd] seq_along and rep_along

2012-01-06 Thread Hadley Wickham
I don't see the benefit of seq_along(mtcars, 1) versus seq_len(nrow(df)) in readability. I like it because: * it reads nicely: I want a sequence along this structure in that direction * it's more consistent: for(i in seq_along(x)) - for(row in seq_along(mtcars, 1)) * it generalised in a

Re: [Rd] R CMD check WARNING \usage question

2012-01-06 Thread Bryan Hanson
Jeff, quick question: is this a data set or a function you are documenting? What you say sounds like it's data, but the Rd file reads more like a function. Or are you trying to document a data format/object which stores specific data sets? Let us know, and I'll bet the answer will appear

Re: [Rd] R CMD check WARNING \usage question

2012-01-06 Thread Bryan Hanson
Jeff, this sounds like a standardized data format, not a function. You are basically telling the user how to put their own data into the correct format. You are not giving them any data (at least not with this file), and you are not giving them a function because there is no function here to

Re: [Rd] R CMD check WARNING \usage question

2012-01-06 Thread Duncan Murdoch
On 12-01-06 2:48 PM, Jeff Hamann wrote: I know I should provide a better answer, but I think it's really for a function. For this package, we simply pass a list object about, but have to obfuscate it using a domain familiar nomenclature for the users. So, not a data set, but a function. I

Re: [Rd] delete.response leaves response in attribute dataClasses

2012-01-06 Thread William Dunlap
-Original Message- From: Paul Johnson [mailto:pauljoh...@gmail.com] Sent: Friday, January 06, 2012 11:17 AM To: William Dunlap Cc: R Devel List Subject: Re: [Rd] delete.response leaves response in attribute dataClasses Thanks, Bill Counter-arguments at the end On Thu, Jan 5,

[Rd] pointers on including SVN revision number in package info?

2012-01-06 Thread Ben Bolker
I'm trying to keep debugging of a development package relatively sane. I see that some packages manage to incorporate what appears to be Subversion (SVN) revision information in the package description; for example, library(MASS) sessionInfo()$otherPkgs$MASS$Revision [1] $Rev: 3016 $

Re: [Rd] pointers on including SVN revision number in package info?

2012-01-06 Thread Prof Brian Ripley
On 06/01/2012 20:24, Ben Bolker wrote: I'm trying to keep debugging of a development package relatively sane. I see that some packages manage to incorporate what appears to be Subversion (SVN) revision information in the package description; for example, library(MASS)

Re: [Rd] pointers on including SVN revision number in package info?

2012-01-06 Thread Dirk Eddelbuettel
On 6 January 2012 at 20:37, Prof Brian Ripley wrote: | The Subversion book? The MASS/DESCRIPTION file has | | gannet% svn proplist DESCRIPTION | Properties on 'DESCRIPTION': |svn:keywords Yep, I do the same for the $Date$ property in my DESCRIPTION files. Upon commit of the file (eg when

Re: [Rd] pointers on including SVN revision number in package info?

2012-01-06 Thread Duncan Murdoch
On 12-01-06 3:24 PM, Ben Bolker wrote: I'm trying to keep debugging of a development package relatively sane. I see that some packages manage to incorporate what appears to be Subversion (SVN) revision information in the package description; for example, library(MASS)