Re: [Rd] R CMD build - will reset the timestamps of all files in a package

2011-10-26 Thread Martin Maechler
> Valentin Todorov 
> on Tue, 25 Oct 2011 14:34:21 -0700 writes:

> After half a year of silence on this issue I would dare
> ask again: is this intended, why and how can I avoid it?

> Best regards, Valentin


> ...  I wonder why (R version 2.13.0 and after) the command
> "R CMD build" sets the timestamp of all files in the
> package to the current date/time. This seems not to be
> mentioned in the list of changes. Is there an option to
> avoid this?  ...

Yes, upgrade to R 2.14.0 (now in "RC" = Release Candidate state)
or newer (and don't use Windows).
The 'NEWS' entry is

• R CMD build on a Unix-alike (only) now tries to preserve dates on
  files it copies from its input directory.  (This was the
  undocumented behaviour prior to R 2.13.0.)

Best regards,
and thanks for persevering ( and *NO thanks* for using Nabble :-( )

Martin

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


Re: [Rd] strsplit convert data

2011-10-26 Thread Martin Maechler
> Joris Meys 
> on Tue, 25 Oct 2011 15:26:10 +0200 writes:

> This is a question for R-Help, not for R-devel by all
> means. You're lucky to get an answer, but please use the
> right channels in the future.

Yes indeed!

{@ others: do not help in such cases;  R-devel is *not* for such questions!}

Martin Maechler
(as  'mailing lists @r-project.org'  site administrator).

> Cheers Joris

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


[Rd] Error message library()

2011-10-26 Thread ONKELINX, Thierry
Dear all,

When one tries to load a non-installed package you get the error: 

Error in library(xyz) : there is no package called 'xyz'

I noticed on several occasions that this puzzles beginners. Therefore I suggest 
to change the error description in:

Error in library(xyz) : there is no package called 'xyz' installed on this 
machine. Check the name of the package or use install.packages("xyz") to 
install it.

Best regards,

Thierry


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
thierry.onkel...@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than 
asking him to perform a post-mortem examination: he may be able to say what the 
experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure 
that a reasonable answer can be extracted from a given body of data.
~ John Tukey

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


[Rd] typo in hcl.Rd

2011-10-26 Thread Manuel López-Ibáñez

This doesn't seem important enough to create a bug report.

Apply to http://svn.r-project.org/R/trunk/src/library/grDevices/man/hcl.Rd


Cheers,
Manuel.


--- hcl.Rd	2011-06-20 03:51:45.0 +0200
+++ hcl.Rd-fixed	2011-10-26 16:45:44.197152229 +0200
@@ -99,7 +99,7 @@
 csphd(hcl(h = c(30, 120, 210, 300)))
 
 # Same, but lighter and less colorful
-# Turn of automatic correction to make sure
+# Turn off automatic correction to make sure
 # that we have defined real colors.
 csphd(hcl(h = c(30, 120, 210, 300),
   c = 20, l = 90, fixup = FALSE))
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] typo in hcl.Rd

2011-10-26 Thread Duncan Murdoch

On 26/10/2011 10:49 AM, Manuel López-Ibáñez wrote:

This doesn't seem important enough to create a bug report.

Apply to http://svn.r-project.org/R/trunk/src/library/grDevices/man/hcl.Rd



Thanks, will do.

Duncan Murdoch

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


Re: [Rd] Error message library()

2011-10-26 Thread Milan Bouchet-Valat
Le mercredi 26 octobre 2011 à 09:46 +, ONKELINX, Thierry a écrit :
> Dear all,
> 
> When one tries to load a non-installed package you get the error: 
> 
> Error in library(xyz) : there is no package called 'xyz'
> 
> I noticed on several occasions that this puzzles beginners. Therefore
> I suggest to change the error description in:
> 
> Error in library(xyz) : there is no package called 'xyz' installed on
> this machine. Check the name of the package or use
> install.packages("xyz") to install it.
Couldn't R even directly ask for installing if it exists on CRAN? Like:
Error in library(xyz) : package 'xyz' is not installed on this machine.
Do you want to install it? [Y/n]

Regards

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


Re: [Rd] Error message library()

2011-10-26 Thread Simon Urbanek

On Oct 26, 2011, at 6:49 AM, Milan Bouchet-Valat wrote:

> Le mercredi 26 octobre 2011 à 09:46 +, ONKELINX, Thierry a écrit :
>> Dear all,
>> 
>> When one tries to load a non-installed package you get the error: 
>> 
>> Error in library(xyz) : there is no package called 'xyz'
>> 
>> I noticed on several occasions that this puzzles beginners. Therefore
>> I suggest to change the error description in:
>> 
>> Error in library(xyz) : there is no package called 'xyz' installed on
>> this machine. Check the name of the package or use
>> install.packages("xyz") to install it.
> Couldn't R even directly ask for installing if it exists on CRAN? Like:
> Error in library(xyz) : package 'xyz' is not installed on this machine.
> Do you want to install it? [Y/n]
> 

Please, no! We don't want to enter the realm of the computer assuming it knows 
what you want to do (which is becoming too common nowadays, unfortunately, 
making the interaction more and more annoying). For some users this error 
simply means that they mistyped the package name, so fetching CRAN repos on 
that behalf ranges somewhere between overkill and stupidity. If the user can't 
type install.packages() then I am certainly not confident that the user can use 
R for any reasonable data analysis.

Cheers,
Simon

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


Re: [Rd] Error message library()

2011-10-26 Thread Milan Bouchet-Valat
Le mercredi 26 octobre 2011 à 12:34 -0400, Simon Urbanek a écrit :
> Please, no! We don't want to enter the realm of the computer assuming
> it knows what you want to do (which is becoming too common nowadays,
> unfortunately, making the interaction more and more annoying). For
> some users this error simply means that they mistyped the package
> name, so fetching CRAN repos on that behalf ranges somewhere between
> overkill and stupidity.
If we need to connect to CRAN to do that, I indeed withdraw my
suggestion. I had in mind a feature that's present in Bash in some
recent Linux distributions: when a program doesn't exist on the system,
tell the user in what package it can be found (it also detects typos in
program names).

> If the user can't type install.packages() then I am certainly not
> confident that the user can use R for any reasonable data analysis.
There's certainly some truth in your statement. ;-)

OTOH it seems package authors have tried raising the barrier to a quite
high level, and even when knowing what you do, you can get the package
names wrong. Consider for example :
Snowball, but snow and snowfall
rJava and rJython, but RODBC and RWeka
(not to pick on Kurt at all, there are many other examples, but I'm
mainly using these - great - packages)

Maybe a less controversial improvement would be to ask "Did you mean
XXX?" if a package with a very similar name is *installed*. That
wouldn't require fetching information from CRAN, and would most of the
time be helpful (people install packages they use).


Regards

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


Re: [Rd] Error message library()

2011-10-26 Thread Simon Urbanek

On Oct 26, 2011, at 1:05 PM, Milan Bouchet-Valat wrote:

> Le mercredi 26 octobre 2011 à 12:34 -0400, Simon Urbanek a écrit :
>> Please, no! We don't want to enter the realm of the computer assuming
>> it knows what you want to do (which is becoming too common nowadays,
>> unfortunately, making the interaction more and more annoying). For
>> some users this error simply means that they mistyped the package
>> name, so fetching CRAN repos on that behalf ranges somewhere between
>> overkill and stupidity.
> If we need to connect to CRAN to do that, I indeed withdraw my
> suggestion. I had in mind a feature that's present in Bash in some
> recent Linux distributions: when a program doesn't exist on the system,
> tell the user in what package it can be found (it also detects typos in
> program names).
> 

Yes, and that thing drives me crazy so the first thing I do on Ubuntu is to 
remove it (which is not as easy as it should due to a bug in the bash script as 
it turns out - another story :P). In 99% of cases it's useless since the 
suggestions are based on typos ...


>> If the user can't type install.packages() then I am certainly not
>> confident that the user can use R for any reasonable data analysis.
> There's certainly some truth in your statement. ;-)
> 
> OTOH it seems package authors have tried raising the barrier to a quite
> high level, and even when knowing what you do, you can get the package
> names wrong. Consider for example :
> Snowball, but snow and snowfall
> rJava and rJython, but RODBC and RWeka
> (not to pick on Kurt at all, there are many other examples, but I'm
> mainly using these - great - packages)
> 

Well, seeing one of my packages on the list I have to say that there were good 
reasons, albeit they may not be known to the user, especially since the reasons 
may be obsolete by now.


> Maybe a less controversial improvement would be to ask "Did you mean
> XXX?" if a package with a very similar name is *installed*. That
> wouldn't require fetching information from CRAN, and would most of the
> time be helpful (people install packages they use).
> 

Yes, that could be an optional feature -- I do want to stress the *optional* in 
the sentence, though.

BTW: an ever more intuitive solution (IMHO) would be to auto-complete package 
names in library( ... Deepayan? ;) That is non-intrusive and in line with the 
general use of R.

Cheers,
Simon


> 
> Regards
> 
> 

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


Re: [Rd] Error message library()

2011-10-26 Thread Kevin Wright
Thierry,

I agree with you and think that computers _should_ help users.

When R tells me a package does not exist, it is almost never because I
typed an incorrect package name.

Almost always it is because:
(1) I am using an old script with a new version of R and have not yet
installed a package.
(2) I am running a current script on a different machine that does not have
a package installed.
(3) I am copying some code from the web and have not yet installed a
package.

MiKTeX does a nice job of auto-installing packages in a silent manner.
I've tried to imitate that with the function below.  I add this to
.Rprofile.  Then use "lib(pkg)" to install and attach packages
automatically.  The function is rough and needs improvement, but works
reasonably well.

Kevin


assign("lib",
   function(p=NULL, ...){
 # Why ... ?
 p <- substitute(p)
 if(!is.null(p) & !is.character(p))
   p <- deparse(substitute(p))
 print(p)
 ip <- rownames(installed.packages())
 # Should be more clever here and only install some of 'p'
 if(!(p %in% ip)) install.packages(p)

 require(p, ..., character.only=TRUE)
   }, env=startup)



On Wed, Oct 26, 2011 at 4:46 AM, ONKELINX, Thierry  wrote:

> Dear all,
>
> When one tries to load a non-installed package you get the error:
>
> Error in library(xyz) : there is no package called 'xyz'
>
> I noticed on several occasions that this puzzles beginners. Therefore I
> suggest to change the error description in:
>
> Error in library(xyz) : there is no package called 'xyz' installed on this
> machine. Check the name of the package or use install.packages("xyz") to
> install it.
>
> Best regards,
>
> Thierry
>
>
> 
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek
> team Biometrie & Kwaliteitszorg
> Gaverstraat 4
> 9500 Geraardsbergen
> Belgium
>
> Research Institute for Nature and Forest
> team Biometrics & Quality Assurance
> Gaverstraat 4
> 9500 Geraardsbergen
> Belgium
>
> tel. + 32 54/436 185
> thierry.onkel...@inbo.be
> www.inbo.be
>
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of.
> ~ Sir Ronald Aylmer Fisher
>
> The plural of anecdote is not data.
> ~ Roger Brinner
>
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

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


Re: [Rd] Error message library()

2011-10-26 Thread Hadley Wickham
> Please, no! We don't want to enter the realm of the computer assuming it 
> knows what you want to do (which is becoming too common nowadays, 
> unfortunately, making the interaction more and more annoying). For some users 
> this error simply means that they mistyped the package name, so fetching CRAN 
> repos on that behalf ranges somewhere between overkill and stupidity. If the 
> user can't type install.packages() then I am certainly not confident that the 
> user can use R for any reasonable data analysis.

In that case, maybe a better message should be:

> library(xyz)
Error in library(xyz) : there is no package called 'xyz'.
Are you sure you are smart enough to use R?

;)

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

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


Re: [Rd] Error message library()

2011-10-26 Thread Simon Urbanek

On Oct 26, 2011, at 4:06 PM, Hadley Wickham wrote:

>> Please, no! We don't want to enter the realm of the computer assuming it 
>> knows what you want to do (which is becoming too common nowadays, 
>> unfortunately, making the interaction more and more annoying). For some 
>> users this error simply means that they mistyped the package name, so 
>> fetching CRAN repos on that behalf ranges somewhere between overkill and 
>> stupidity. If the user can't type install.packages() then I am certainly not 
>> confident that the user can use R for any reasonable data analysis.
> 
> In that case, maybe a better message should be:
> 
>> library(xyz)
> Error in library(xyz) : there is no package called 'xyz'.
> Are you sure you are smart enough to use R?
> 
> ;)
> 

Unfortunately we are in code freeze, so it will only make it into 2.14.0 
patched ... ;)

Cheers,
Simon

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