RE: [Rd] delay() has been deprecated for 2.1.0

2005-03-14 Thread Mark.Bravington
[MVB] 
[snip]
> >
> >> makeActiveBinding( 'myAB', function( x) if( missing( x)) get( 
> >> 'myABguts', env=.GlobalEnv) else assign( 'myABguts', x, 
> .GlobalEnv), 
> >> exists( 'myAB')
> >
> > which appeared to return absolutely nothing-- not even a 
> missing or a null. The problem, of course, is that 'myABguts' 
> doesn't exist yet; what seems to happen, though,  is that the 
> failure to 'get' causes a *messageless* error inside the 
> active binding function. Is this intended?
> 

[Luke Tierney]
> What I get is this:
>  > exists( 'myAB')
>  Error in get(x, envir, mode, inherits) : variable 
> "myABguts" was not found

[MVB]
Hmmm, yes, this morning that's exactly what I get too. I was running
this on a different machine (also R2.0.1 under Windows XP) when I
repeatedly got the messageless error which prompted my question. I'll
see whether I can re-reproduce it on that system.

Thanks
Mark

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


[Rd] Small suggestion for stripchart help

2005-03-14 Thread kwright

I needed to look up information about the 'jitter' argument of stripchart.
 When I opened the help page for jitter I found:

jitter  when jittering is used, jitter gives the amount of jittering applied.

which is slightly confusing/self-referential if you are lazy and don't
read the entire page.

It might be clearer to say

jitter  when \code{method="jitter"} is used, jitter gives the amount of
jittering applied.


Just my opinion.  Thanks for listening.

Kevin Wright

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


FW: [Rd] Package Installation in RGui (PR#7262)

2005-03-14 Thread Gorjanc Gregor
I didn't load the package. I wasn't able to do that, since I wasn't
successfull to install it in first place with install.packages.

-Original Message-
From: Uwe Ligges [mailto:[EMAIL PROTECTED]
Sent: pon 2005-03-14 15:34
To: Gorjanc Gregor
Cc: r-devel@stat.math.ethz.ch
Subject: Re: [Rd] Package Installation in RGui (PR#7262)
 
Under Windows, you cannot update / install  a package, if the package 
has been loaded, because Windows locks the dll. This is a FAQ.

Uwe Ligges



Gorjanc Gregor wrote:

> Hello!
> 
> I have just encountered the same situation as Heather and also Paul Gilbert at
> 
> http://tolstoy.newcastle.edu.au/R/devel/05/02/2095.html
> 
> I went into install.packages() in current release as well as in R-devel and
> there is really no problem with \ or /. However, I also had the same warning
> 
> 
>>install.packages("RODBC")
> 
> [... snip ...]
> Delete downloaded files (y/N)? y
> 
> updating HTML package descriptions
> Warning message: 
> unable to move temp installation 
> 'N:/Ovce/Programi/R/rw2001/library\file27583/RODBC' to 
> 'N:/Ovce/Programi/R/rw2001/library/RODBC' 
> 
> The warning is issued from this part of install.packages()
> 
> if (ret == 0) {
> ## Move the new package to the install lib and
> ## remove our temp dir
> ret <- file.rename(file.path(tmpDir, curPkg), instPath)
> if(!ret) warning("unable to move temp installation ",
>  sQuote(file.path(tmpDir, curPkg)),
>  " to ",
>  sQuote(instPath), call. = FALSE)
> } else {
> ## !! Can't revert to old 'zip.unpack' as it would
> ## !! potentially leave cruft from a bundle in there
> stop("Can not remove prior installation of package ",
>  sQuote(curPkg), call. = FALSE)
> }
> 
> "Problem" lies in 
> 
> ret <- file.rename(file.path(tmpDir, curPkg), instPath)
> 
> I went through the whole function "by hand" and at first the above line
> didn't moved tmpDir to instPath. I tried several times and after a while
> it was successfull. It is strange that it happens only with some packages
> i.e. in my case with RODBC and car. I also noted that line above takes 
> quite a lot of time to "accomplish" its work. It actually causes R to 
> freeze for a moment. If I launched
> 
> file.rename(file.path(tmpDir, curPkg), instPath)
> 
> move was done in a moment. I know, that this comment is not the answer 
> to the problem. However, someone might come with that.
> 
> One more thing. I have R installed on networked disk. I assume that Heather 
> does also, since disk letter is H. On the other hand, Paul reported problems
> with C disk.
> 
> Windows XP SP1
> R 2.0.1
> 
> On Tue, 5 Oct 2004 [EMAIL PROTECTED] wrote:
> 
>>Full_Name: Heather Turner
>>Version: 2.0.0
>>OS: Windows NT
>>Submission from: (NULL) (137.205.8.2)
>>
>>
>>I tried using the Packages menu to install the gam package and get the 
>>following
>>output:
>>
>>
>>>local({a <- CRAN.packages()
>>
>>+ install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a,
>>dependencies=TRUE)})
>>trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
>>Content type `text/plain; charset=iso-8859-1' length 21246 bytes
>>opened URL
>>downloaded 20Kb
>>
>>trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/gam_0.92.zip'
>>Content type `application/zip' length 224167 bytes
>>opened URL
>>downloaded 218Kb
>>
>>package 'gam' successfully unpacked and MD5 sums checked
>>
>>Delete downloaded files (y/N)? y
>>
>>Warning message:
>>unable to move temp installation 'H:/rw2000/library\file15762/gam' to
>>'H:/rw2000/library/gam'
>>
>>I get the same message if I opt to delete the downloaded files and the
>>same problem if I try to install from a downloaded .zip file instead -
>>not really surprising as seems to "unpack" file okay, but loses the
>>temporary file. As the syntax of the file path for the temporary file is
>>incorrect, I'm assuming this is a bug in install.packages or one of the
>>functions it calls...
> 
> 
> Since you _incorrectly_ assume that the syntax is incorrect, the rest of
> your assumption is incorrect. As the FAQ asks, please don't speculate
> about things you are not expert about, but stick to facts. Also as the
> FAQ asks, don't misuse R-bugs for things you do not know _for sure_ are
> bugs in R.
> 
> FYI, Windows accepts both /and \ in file paths, including a mixture. If
> your speculation was correct install.packages() would work for no one, and
> do you seriously think that such a bug would go unreported and unfixed.
> 
> We have seen this once before, and it was a Windows bug solved by updating
> Windows to the latest set of patches. Since you have not reported a
> precise version of Windows, it is hard for us to know what you were using,
> but if you mean NT4.0, that is rather old (last Service Pa

Re: [Rd] Package Installation in RGui (PR#7262)

2005-03-14 Thread Uwe Ligges
Under Windows, you cannot update / install  a package, if the package 
has been loaded, because Windows locks the dll. This is a FAQ.

Uwe Ligges

Gorjanc Gregor wrote:
Hello!
I have just encountered the same situation as Heather and also Paul Gilbert at
http://tolstoy.newcastle.edu.au/R/devel/05/02/2095.html
I went into install.packages() in current release as well as in R-devel and
there is really no problem with \ or /. However, I also had the same warning

install.packages("RODBC")
[... snip ...]
Delete downloaded files (y/N)? y
updating HTML package descriptions
Warning message: 
unable to move temp installation 'N:/Ovce/Programi/R/rw2001/library\file27583/RODBC' to 'N:/Ovce/Programi/R/rw2001/library/RODBC' 

The warning is issued from this part of install.packages()
if (ret == 0) {
## Move the new package to the install lib and
## remove our temp dir
ret <- file.rename(file.path(tmpDir, curPkg), instPath)
if(!ret) warning("unable to move temp installation ",
 sQuote(file.path(tmpDir, curPkg)),
 " to ",
 sQuote(instPath), call. = FALSE)
} else {
## !! Can't revert to old 'zip.unpack' as it would
## !! potentially leave cruft from a bundle in there
stop("Can not remove prior installation of package ",
 sQuote(curPkg), call. = FALSE)
}
"Problem" lies in 

ret <- file.rename(file.path(tmpDir, curPkg), instPath)
I went through the whole function "by hand" and at first the above line
didn't moved tmpDir to instPath. I tried several times and after a while
it was successfull. It is strange that it happens only with some packages
i.e. in my case with RODBC and car. I also noted that line above takes 
quite a lot of time to "accomplish" its work. It actually causes R to 
freeze for a moment. If I launched

file.rename(file.path(tmpDir, curPkg), instPath)
move was done in a moment. I know, that this comment is not the answer 
to the problem. However, someone might come with that.

One more thing. I have R installed on networked disk. I assume that Heather 
does also, since disk letter is H. On the other hand, Paul reported problems
with C disk.

Windows XP SP1
R 2.0.1
On Tue, 5 Oct 2004 [EMAIL PROTECTED] wrote:
Full_Name: Heather Turner
Version: 2.0.0
OS: Windows NT
Submission from: (NULL) (137.205.8.2)
I tried using the Packages menu to install the gam package and get the 
following
output:

local({a <- CRAN.packages()
+ install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a,
dependencies=TRUE)})
trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 21246 bytes
opened URL
downloaded 20Kb
trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/gam_0.92.zip'
Content type `application/zip' length 224167 bytes
opened URL
downloaded 218Kb
package 'gam' successfully unpacked and MD5 sums checked
Delete downloaded files (y/N)? y
Warning message:
unable to move temp installation 'H:/rw2000/library\file15762/gam' to
'H:/rw2000/library/gam'
I get the same message if I opt to delete the downloaded files and the
same problem if I try to install from a downloaded .zip file instead -
not really surprising as seems to "unpack" file okay, but loses the
temporary file. As the syntax of the file path for the temporary file is
incorrect, I'm assuming this is a bug in install.packages or one of the
functions it calls...

Since you _incorrectly_ assume that the syntax is incorrect, the rest of
your assumption is incorrect. As the FAQ asks, please don't speculate
about things you are not expert about, but stick to facts. Also as the
FAQ asks, don't misuse R-bugs for things you do not know _for sure_ are
bugs in R.
FYI, Windows accepts both /and \ in file paths, including a mixture. If
your speculation was correct install.packages() would work for no one, and
do you seriously think that such a bug would go unreported and unfixed.
We have seen this once before, and it was a Windows bug solved by updating
Windows to the latest set of patches. Since you have not reported a
precise version of Windows, it is hard for us to know what you were using,
but if you mean NT4.0, that is rather old (last Service Pack five years
ago I read yesterday).
__
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Package Installation in RGui (PR#7262)

2005-03-14 Thread Gorjanc Gregor
Hello!

I have just encountered the same situation as Heather and also Paul Gilbert at

http://tolstoy.newcastle.edu.au/R/devel/05/02/2095.html

I went into install.packages() in current release as well as in R-devel and
there is really no problem with \ or /. However, I also had the same warning

> install.packages("RODBC")
[... snip ...]
Delete downloaded files (y/N)? y

updating HTML package descriptions
Warning message: 
unable to move temp installation 
'N:/Ovce/Programi/R/rw2001/library\file27583/RODBC' to 
'N:/Ovce/Programi/R/rw2001/library/RODBC' 

The warning is issued from this part of install.packages()

if (ret == 0) {
## Move the new package to the install lib and
## remove our temp dir
ret <- file.rename(file.path(tmpDir, curPkg), instPath)
if(!ret) warning("unable to move temp installation ",
 sQuote(file.path(tmpDir, curPkg)),
 " to ",
 sQuote(instPath), call. = FALSE)
} else {
## !! Can't revert to old 'zip.unpack' as it would
## !! potentially leave cruft from a bundle in there
stop("Can not remove prior installation of package ",
 sQuote(curPkg), call. = FALSE)
}

"Problem" lies in 

ret <- file.rename(file.path(tmpDir, curPkg), instPath)

I went through the whole function "by hand" and at first the above line
didn't moved tmpDir to instPath. I tried several times and after a while
it was successfull. It is strange that it happens only with some packages
i.e. in my case with RODBC and car. I also noted that line above takes 
quite a lot of time to "accomplish" its work. It actually causes R to 
freeze for a moment. If I launched

file.rename(file.path(tmpDir, curPkg), instPath)

move was done in a moment. I know, that this comment is not the answer 
to the problem. However, someone might come with that.

One more thing. I have R installed on networked disk. I assume that Heather 
does also, since disk letter is H. On the other hand, Paul reported problems
with C disk.

Windows XP SP1
R 2.0.1

On Tue, 5 Oct 2004 [EMAIL PROTECTED] wrote:
> Full_Name: Heather Turner
> Version: 2.0.0
> OS: Windows NT
> Submission from: (NULL) (137.205.8.2)
>
>
> I tried using the Packages menu to install the gam package and get the 
> following
> output:
>
> > local({a <- CRAN.packages()
> + install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a,
> dependencies=TRUE)})
> trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
> Content type `text/plain; charset=iso-8859-1' length 21246 bytes
> opened URL
> downloaded 20Kb
>
> trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/gam_0.92.zip'
> Content type `application/zip' length 224167 bytes
> opened URL
> downloaded 218Kb
>
> package 'gam' successfully unpacked and MD5 sums checked
>
> Delete downloaded files (y/N)? y
>
> Warning message:
> unable to move temp installation 'H:/rw2000/library\file15762/gam' to
> 'H:/rw2000/library/gam'
>
> I get the same message if I opt to delete the downloaded files and the
> same problem if I try to install from a downloaded .zip file instead -
> not really surprising as seems to "unpack" file okay, but loses the
> temporary file. As the syntax of the file path for the temporary file is
> incorrect, I'm assuming this is a bug in install.packages or one of the
> functions it calls...

Since you _incorrectly_ assume that the syntax is incorrect, the rest of
your assumption is incorrect. As the FAQ asks, please don't speculate
about things you are not expert about, but stick to facts. Also as the
FAQ asks, don't misuse R-bugs for things you do not know _for sure_ are
bugs in R.

FYI, Windows accepts both /and \ in file paths, including a mixture. If
your speculation was correct install.packages() would work for no one, and
do you seriously think that such a bug would go unreported and unfixed.

We have seen this once before, and it was a Windows bug solved by updating
Windows to the latest set of patches. Since you have not reported a
precise version of Windows, it is hard for us to know what you were using,
but if you mean NT4.0, that is rather old (last Service Pack five years
ago I read yesterday).

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

--
Lep pozdrav / With regards,
Gregor GORJANC


University of Ljubljana
Biotechnical Faculty   URI: http://www.bfro.uni-lj.si/MR/ggorjan
Zootechnical Departmentemail: gregor.gorjanc  bfro.uni-lj.si
Groblje 3  tel: +386 (0)1 72 17 861
SI-12

Re: [Rd] Use of htest class for different tests

2005-03-14 Thread Martin Maechler
> "Torsten" == Torsten Hothorn <[EMAIL PROTECTED]>
> on Mon, 14 Mar 2005 13:43:32 +0100 (CET) writes:

Torsten> On Sun, 13 Mar 2005, Gorjanc Gregor wrote:
>> Hello!
>> 
>> First of all I must appologize if this has been raised
>> previously, but search provided by Robert King at the
>> University of Newcastle seems to be down these
>> days. Additionally let me know if such a question should
>> be sent to R-help.
>> 
>> I did a contribution to function hwe.hardy in package
>> 'gap' during the weekend. That functions performs
>> Hardy-Weinberg equilibrium test using MCMC. The return of
>> the function does not have classical components for htest
>> class so I was afcourse not successfull in using
>> it. However, I managed to copy and modify some part of
>> print.htest to accomplish the same task.
>> 
>> Now my question is what to do in such cases? Just copy
>> parts of print.htest and modify for each test or anything
>> else. Are such cases rare? If yes, then mentioned
>> approach is probably the easiest.
>> 

Torsten> you can use print.htest directly for the components
Torsten> which _are_ elements of objects of class `htest'
Torsten> and provide your one print method for all
Torsten> others. If your class `foo' (essentially) extends
Torsten> `htest', a simple version of `print.foo' could by

   Torsten>  print.foo <- function(x, ...) {
   Torsten>  
   Torsten> # generate an object of class `htest'
   Torsten> y <- x
   Torsten> class(y) <- "htest"
   Torsten> # maybe modify some thinks like y$method
   Torsten> ...
   Torsten> # print y using `print.htest' without copying code
   Torsten> print(y)
   Torsten>  
   Torsten> # and now print additional information
   Torsten> cat(x$whatsoever)
   Torsten>  
   Torsten>  }

and if you want to really `comply to standards'
you should end your print method with

invisible(x)

Martin Maechler, ETH Zurich

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


Re: [Rd] Use of htest class for different tests

2005-03-14 Thread Torsten Hothorn
On Sun, 13 Mar 2005, Gorjanc Gregor wrote:

> Hello!
>
> First of all I must appologize if this has been raised previously, but
> search provided by Robert King at the University of Newcastle seems to
> be down these days. Additionally let me know if such a question should
> be sent to R-help.
>
> I did a contribution to function hwe.hardy in package 'gap' during the
> weekend. That functions performs Hardy-Weinberg equilibrium test using
> MCMC. The return of the function does not have classical components for
> htest class so I was afcourse not successfull in using it. However, I
> managed to copy and modify some part of print.htest to accomplish the
> same task.
>
> Now my question is what to do in such cases? Just copy parts of
> print.htest and modify for each test or anything else. Are such cases
> rare? If yes, then mentioned approach is probably the easiest.
>

you can use print.htest directly for the components which _are_ elements
of objects of class `htest' and provide your one print method for all
others. If your class `foo' (essentially) extends `htest', a
simple version of `print.foo' could by

print.foo <- function(x, ...) {

   # generate an object of class `htest'
   y <- x
   class(y) <- "htest"
   # maybe modify some thinks like y$method
   ...
   # print y using `print.htest' without copying code
   print(y)

   # and now print additional information
   cat(x$whatsoever)

}



> --
> Lep pozdrav / With regards,
> Gregor GORJANC
>
> 
> University of Ljubljana
> Biotechnical Faculty   URI: http://www.bfro.uni-lj.si/MR/ggorjan
> Zootechnical Departmentemail: gregor.gorjanc  bfro.uni-lj.si
> Groblje 3  tel: +386 (0)1 72 17 861
> SI-1230 Domzalefax: +386 (0)1 72 17 888
> Slovenia
>
> __
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

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


[Rd] ks.test (Kolmogorov-Smirnov) (PR#7725)

2005-03-14 Thread jpnolan
Full_Name: John Nolan
Version: 2.0.1
OS: Win XP
Submission from: (NULL) (151.200.9.43)


I think there are two small bugs in the Kolmogorov Smirnov test routines.  

(1) In the R function ks.test, toward the bottom, the internal function pkstwo
does:

 p[IND] <- .C("pkstwo", as.integer(length(x)), p = as.double(x[IND]), 
as.double(tol), PACKAGE = "stats")$p

Instead of length(x), shouldn't length(x[IND]) be passed?  If there are NAs,
length(x) > length(x[IND]) and the called C routine will try to process more
values than it should.


(2) In C routine ks.c, the function pkstwo describes two series it evaluates,
depending on whether x > 1 or x < 1.  The second case uses a formula described 
in the comments at the head of the function as

 *   = \sqrt{2\pi/x} \sum_{k=1}^\infty \exp(-(2k-1)^2\pi^2/(8x^2))

The code actually evaluates  \sqrt{2\pi}/x, not \sqrt{2\pi/x}.  I am not sure
which equation is right: both agree at x=1 so there is no easy test here.
If the equation is correct, the code should be changed to have w =
0.5*log(x[i]),
not w = log(x[i]).  If the code is right, change the equation in the comment.

John Nolan

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