Re: [Rd] tar R command

2010-11-28 Thread Henrik Bengtsson
First, if you look carefully, then you see that argument 'files' should specify *filepaths*, i.e. directories and not specific files. Thus, if you for instance place your files in directory "foo/" and then call tar("foo.tar", files="foo/"); you would do the right thing. HOWEVER, looking at the i

[Rd] tar R command

2010-11-28 Thread Dario Strbenac
Hello, The documentation for the tar command leads me to think there is an internal implementation when the command can't be found in the OS. However, it doesn't seem to be the case, as I get an empty .tar file generated on a small example I made : > dir(pattern = "jpg") [1] "MA56237502_635.jp

Re: [Rd] Bug in parseNamespaceFile or switch( , ... ) ?

2010-11-28 Thread Duncan Murdoch
On 27/11/2010 7:09 PM, Duncan Murdoch wrote: On 27/11/2010 6:50 PM, Duncan Murdoch wrote: On 27/11/2010 5:58 PM, Charles C. Berry wrote: parseNamespaceFile() doesn't seem to detect misspelled directives. Looking at its code I see switch(as.character(e[[1L]]), , stop(

Re: [Rd] switch() disallowing multiple default values Re: Bug in parseNamespaceFile or switch( , ... ) ?

2010-11-28 Thread Prof Brian Ripley
On Sun, 28 Nov 2010, Duncan Murdoch wrote: I've now committed changes in R-devel and R-patched to detect cases where a call to switch() contains multiple unnamed alternatives. The code only complains if the EXPR argument is a character string; unnamed alternatives are fine with numeric switch

[Rd] switch() disallowing multiple default values Re: Bug in parseNamespaceFile or switch( , ... ) ?

2010-11-28 Thread Duncan Murdoch
I've now committed changes in R-devel and R-patched to detect cases where a call to switch() contains multiple unnamed alternatives. The code only complains if the EXPR argument is a character string; unnamed alternatives are fine with numeric switching. Adding this check turned up 3 more typ

Re: [Rd] package matrix dummy.cpp

2010-11-28 Thread Prof Brian Ripley
It is Matrix, not matrix I too have corresponded with them about this. It seems to be a legacy from when the package contained C++ code, and can now be deleted. On Sun, 28 Nov 2010, Ambrus Kaposi wrote: Hi, The recommended package matrix contains an empty file src/dummy.cpp which resu

[Rd] package matrix dummy.cpp

2010-11-28 Thread Ambrus Kaposi
Hi, The recommended package matrix contains an empty file src/dummy.cpp which results in using g++ instead of gcc to link Matrix.so. What is the reason for that? Is there any difference between using g++ or gcc? (There are no other cpp files in the source) I asked the maintainers of the package (m

Re: [Rd] .Rdata file in data subdirectory won't load

2010-11-28 Thread Prof Brian Ripley
It needs to be polygon1.RData, not .Rdata. You've not actually told us your OS, but it looks like you imagine that R is case-insensitive just because Windows is. On Sun, 28 Nov 2010, Ronald Barry wrote: Greetings, I wanted to add a dataset to a complete R package I am working on (the packag

Re: [Rd] faster base::sequence

2010-11-28 Thread Romain Francois
Le 28/11/10 11:30, Prof Brian Ripley a écrit : On Sun, 28 Nov 2010, Romain Francois wrote: Le 28/11/10 10:30, Prof Brian Ripley a écrit : Is sequence used enough to warrant this? As the help page says Note that ‘sequence <- function(nvec) unlist(lapply(nvec, seq_len))’ and it mainly exists in

Re: [Rd] faster base::sequence

2010-11-28 Thread Prof Brian Ripley
On Sun, 28 Nov 2010, Romain Francois wrote: Le 28/11/10 10:30, Prof Brian Ripley a écrit : Is sequence used enough to warrant this? As the help page says Note that ‘sequence <- function(nvec) unlist(lapply(nvec, seq_len))’ and it mainly exists in reverence to the very early history of R. I d

[Rd] .Rdata file in data subdirectory won't load

2010-11-28 Thread Ronald Barry
Greetings, I wanted to add a dataset to a complete R package I am working on (the package cleanly installs and passes the R CMD check). The data (a matrix) was saved, and the save() image dragged to the /data folder, and is a .Rdata file. It can be read directly using load (see below), but now t

Re: [Rd] faster base::sequence

2010-11-28 Thread Romain Francois
Le 28/11/10 10:30, Prof Brian Ripley a écrit : Is sequence used enough to warrant this? As the help page says Note that ‘sequence <- function(nvec) unlist(lapply(nvec, seq_len))’ and it mainly exists in reverence to the very early history of R. I don't know. Would it be used more if it were mo

Re: [Rd] faster base::sequence

2010-11-28 Thread Prof Brian Ripley
Is sequence used enough to warrant this? As the help page says Note that ‘sequence <- function(nvec) unlist(lapply(nvec, seq_len))’ and it mainly exists in reverence to the very early history of R. I regard it as unsafe to assume that NA_INTEGER will always be negative, and bear

[Rd] faster base::sequence

2010-11-28 Thread Romain Francois
Hello, Based on yesterday's R-help thread (help: program efficiency), and following Bill's suggestions, it appeared that sequence: > sequence function (nvec) unlist(lapply(nvec, seq_len)) could benefit from being written in C to avoid unnecessary memory allocations. I made this version us