Re: [Rd] Suggestion: Dimension-sensitive attributes

2009-07-08 Thread SIES 73
Hi,

I agree with Henrik that his suggestion to have "dimension vector attributes" 
working like dimnames (see below) would be an extremely useful infrastructure 
adittion to R.

If this is not considered for R-core, I am happy to try to implement this in a 
package, as a new class. And possibly do the same thing for data frames. Should 
you have any comments, ideas or suggestions about it, please share!

Best,

Enrique

-
Subject: 
From: Henrik Bengtsson  x <- array(1:30, dim=c(2,3,5)) 
> dimnames(x) <- list(c("a", "b"), c("a1", "a2", "a3"), NULL); 
> dimattr(x, "misc") <- list(1:2, list(x=1:5, y=letters[1:8], z=NA), 
> letters[1:5]); 


> y <- x[,1:2,2:3] 
> str(dimnames(y)) 

List of 3 

 $ : chr [1:2] "a" "b"
 $ : chr [1:2] "a1" "a2"
 $ : NULL


> str(dimattr(x, "misc")) 

List of 3 
 $ : int [1:2] 1 2 
 $ :List of 2 
  ..$ x: int [1:5] 1 2 3 4 5 
  ..$ y: chr [1:8] "a" "b" "c" "d" ... 
 $ : chr [1:2] "b" "c" 

 I can imagine this needs to be added in several places and functions such as 
is.vector() needs to be updated etc. It is not a quick migration, but is it 
something worth considering for the future? 

/Henrik 

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] "Roxygenating" packages

2009-07-08 Thread Barry Rowlingson
Is there any interest in a method of taking a package with
documentation in Rd files and attaching it to package R files in
Roxygen format? I can see a few problems with a totally general
solution but it might be possible to make a script that provides a
kickstart to converting a package to Roxygen.

Or is it trickier than it seems?

Barry

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Installation of R_2.9.1 & readline (PR#13805)

2009-07-08 Thread Dirk Eddelbuettel

On 6 July 2009 at 08:50, mb990...@uni-greifswald.de wrote:
| Submission from: (NULL) (141.53.34.152)
| 
| 
| Hello,
| when I try to install R by "./configure", I get the following message:
| 
| 
| .
| .
| .
| configure: error: --with-readline=yes (default) and headers/libs are not
| available
| .
| 
| Installation by "./configure --with-readline=no" works, but then I do not have
| the comfort do use the arrow-keys for moving the cursor within a command or
| scrolling through command history. Any ideas?

See http://cran.r-project.org/bin/linux/ubuntu/ for detailed instruction on
getting pre-compiled current versions of R for Ubuntu.

As for your other non-bug bug report, you also get Rcmdr for Ubuntu via 'sudo
apt-get r-cran-rcmdr' --- and the same holds for a number of other CRAN
packages which are already in Ubuntu.

Dirk

-- 
Three out of two people have difficulties with fractions.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] "Roxygenating" packages

2009-07-08 Thread Claudia Beleites
Dear Barry,

I'd definitely be interested. Though I don't have time to do it :-(
But I'd volunteer as test user :-)

--Claudia

> Is there any interest in a method of taking a package with
> documentation in Rd files and attaching it to package R files in
> Roxygen format? I can see a few problems with a totally general
> solution but it might be possible to make a script that provides a
> kickstart to converting a package to Roxygen.
> 
> Or is it trickier than it seems?

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


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
Rowlingson wrote:
> Is there any interest in a method of taking a package with
> documentation in Rd files and attaching it to package R files in
> Roxygen format? I can see a few problems with a totally general
> solution but it might be possible to make a script that provides a
> kickstart to converting a package to Roxygen.
>
> Or is it trickier than it seems?
>
> Barry
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
http://had.co.nz/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion: Dimension-sensitive attributes

2009-07-08 Thread Tony Plate

There have been times when I've thought this could be useful too.

One way to go about it could be to introduce a special attribute that 
controls how attributes are dealt with in subsetting, e.g., 
"attr.dimname.like".  The contents of this would be character data; on 
subsetting, any attribute that had a name appearing in this vector would 
be treated as a dimension.  At the same time, it might be nice to also 
introduce "attr.keep.on.subset", which would specify which attributes 
should be kept on the result of a subsetting operation (could be useful 
for attributes that specify units).  This of course could be a way of 
implementing Henrik's suggestion: dimattr(x, "misc") <- value would add 
"misc" to the "attr.dimname.like" attribute and also set the attribute 
"misc".  The tricky part would be modifying the "[" methods.   However, 
the most useful would probably be the one for ordinary matrices and 
arrays, and others could be modified when and if their maintainers see 
the need.


-- Tony Plate

Bengoechea Bartolomé Enrique (SIES 73) wrote:

Hi,

I agree with Henrik that his suggestion to have "dimension vector attributes" 
working like dimnames (see below) would be an extremely useful infrastructure adittion to 
R.

If this is not considered for R-core, I am happy to try to implement this in a 
package, as a new class. And possibly do the same thing for data frames. Should 
you have any comments, ideas or suggestions about it, please share!

Best,

Enrique

-
Subject: 
From: Henrik Bengtsson Date: Sun, 07 Jun 2009 14:42:08 -0700


Hi, 

maybe this has been suggested before, but would it be possible, without not breaking too much existing code, to add other "dimension vector attributes" in addition to 'dimnames'? These attributes would then be subsetted just like dimnames. 

Something like this: 

  
x <- array(1:30, dim=c(2,3,5)) 
dimnames(x) <- list(c("a", "b"), c("a1", "a2", "a3"), NULL); 
dimattr(x, "misc") <- list(1:2, list(x=1:5, y=letters[1:8], z=NA), letters[1:5]); 




  
y <- x[,1:2,2:3] 
str(dimnames(y)) 



List of 3 


 $ : chr [1:2] "a" "b"
 $ : chr [1:2] "a1" "a2"
 $ : NULL


  
str(dimattr(x, "misc")) 



List of 3 
 $ : int [1:2] 1 2 
 $ :List of 2 
  ..$ x: int [1:5] 1 2 3 4 5 
  ..$ y: chr [1:8] "a" "b" "c" "d" ... 
 $ : chr [1:2] "b" "c" 

 I can imagine this needs to be added in several places and functions such as is.vector() needs to be updated etc. It is not a quick migration, but is it something worth considering for the future? 

/Henrik 


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel




__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] "Roxygenating" packages

2009-07-08 Thread Barry Rowlingson
On Wed, Jul 8, 2009 at 3:53 PM, hadley wickham 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 is going to be working out how to map the
various possibilities of rdoc files into Roxygen syntax.

 We do have a huge potential test suite though, since once the .R
files are passed through Roxygen we should get back the .Rd files that
we started with

 For example, just looking at the sp package, there's gridded.R which
has functions documented in gridded-methods.Rd. Are Rd file names
essentially arbitrary, meaning we need to look at the \alias section
to see what functions are documented? And then if those functions are
in more than one .R file what do we do?

 The various class descriptions and methods also seem to be scattered
amongst various files too. This is not an easy problem...

Barry

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] bug in seq_along

2009-07-08 Thread Kasper Daniel Hansen

Using the IRanges package from Bioconductor and somewhat recent R-2.9.1.

ov = IRanges(1:3, 4:6)
length(ov) # 3
seq(along = ov) # 1 2 3 as wanted
seq_along(ov) # 1!

I had expected that the last line would yield 1:3. My guess is that  
somehow seq_along don't utilize that ov is an S4 class with a length  
method.


The last line of the *Details* section of ?seq has a typeo. Currently  
it is

 'seq.int', 'seq_along' and 'seq.int' are primitive: the latter two
 ignore any argument name.
I would guess it ought to be
 'seq.int', 'seq_along' and 'seq_len' are primitive: the latter two
 ignore any argument name.

Kasper

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel