Re: [Rd] strange bug? with R CMD check

2009-07-22 Thread Kjell Konis
Yes, I managed to work around the problem. You can still reproduce the  
strange behavior with revision 5 of the package though.


svn checkout svn://svn.r-forge.r-project.org/svnroot/sbr/p...@5  
safeBinaryRegression


Kjell


On 22 juil. 09, at 07:31, Paul Johnson wrote:


I am guessing you solved this, because I just downloaded your svn
files and there's no more "sbr" and the check passes on my system.

Right?

pj

On Tue, Jul 21, 2009 at 8:32 AM, Kjell Konis  
wrote:

Hello,

I am trying to get a package to pass R CMD check on an iMac running  
Mac OS
X.  When the package is named safeBinaryRegression I get the  
following

warning from R CMD check:

* checking whether the name space can be loaded with stated  
dependencies ...

WARNING
Error in dyn.load(file, DLLpath = DLLpath, ...) :
 function 'make_lp' not provided by package 'lpSolveAPI'
Calls: loadNamespace -> library.dynam -> dyn.load
Execution halted

A namespace must be able to be loaded with just the base namespace  
loaded:
otherwise if the namespace gets loaded by a saved object, the  
session will

be unable to start.

Probably some imports need to be declared in the NAMESPACE file.


Here is the contents of the DESCRIPTION:

Package: safeBinaryRegression
Version: 0.1-2
Date: 2009-07-01
Title: Safe Binary Regression
Author: Kjell Konis 
Maintainer: Kjell Konis 
Depends: R (>= 2.9.1), lpSolveAPI (>= 5.5.0.14)
LinkingTo: lpSolveAPI
Description: Overloads the stats::glm function so that a test for the
existence of
 the maximum likelihood estimate is computed as part of the fitting
procedure for
 binary regression models.
License: GPL-2


Here is the contents of the NAMESPACE:

export(glm)
useDynLib(safeBinaryRegression, linprog, reducedLP)


The strange thing is that if I change the length of the package  
name (for
example safeBinaryRegression to safeBinaryRegress) the warning goes  
away and
R CMD check completes successfully.  Also, regardless of the  
package name,
the package installs and runs as expected.  I'm at a loss trying to  
figure

out what's going on.

To reproduce:

(1) check out the sbr package (which passes R CMD check)

 svn checkout svn://svn.r-forge.r-project.org/svnroot/sbr/pkg
safeBinaryRegression

(2) replace sbr with safeBinaryRegression in DESCRIPTION and  
NAMESPACE


(3) run R CMD check


Session Info:


sessionInfo()

R version 2.9.1 (2009-06-26)
i386-apple-darwin8.11.1

locale:
fr_CH.UTF-8/en_US.UTF-8/C/C/fr_CH.UTF-8/fr_CH.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

Thanks,
Kjell

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





--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas


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


Re: [Rd] Rcmd check fails on Windows Samba network path in R 2.9.1

2009-07-22 Thread Henrik Bengtsson
See r-devel thread '[Rd] file.access() on network (mounted) drive on
Windows Vista' on Nov 26, 2008:

  http://tolstoy.newcastle.edu.au/R/e5/devel/08/11/0806.html

where it was concluded that file.access() is "not 100%", e.g.
file.access() and file.info() can give different answers.

I added fileAccess(..., safe=TRUE) to R.utils, which imitates
file.access() but relies also on file.info() and file.exists() to
infer the rights.  It is still not 100% but (hopefully) closer than
file.access().

/H

On Tue, Jul 21, 2009 at 1:55 PM, Kevin R.
Coombes wrote:
> Hi,
>
> The problem almost certainly has something to do with Samba.  We also have a
> NetApp file system, and copying the package source to that drive and running
> Rcmd check from Windows works just fine.
>
> When running the commands from an interactive R session, file_test returns
> TRUE and file.access to test write permission indicates a failure, even
> though that information is incorrect.Here is a session transcript:
>
> -
>> getwd()
> [1] "n:/krc/Umpire/R-Package"
>> lib <- "Umpire.Rcheck"
>> file_test("-d", lib)
> [1] TRUE
>> file.access(lib, 2)
> Umpire.Rcheck
>          -1
>> dir.create(paste(lib, "testdir", sep='/'))
>> dir(lib)
> [1] "00check.log"   "00install.out" "testdir"     > sessionInfo()
> R version 2.9.1 (2009-06-26)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> Again, this all worked (and still works) correctly in 2.8.1.
>
>   Kevin
>
> Tony Plate wrote:
>>
>> This error message looks like it comes from src/library/tools/R/install.R,
>> which contains the following test:
>>
>>   if (!.file_test("-d", lib) || file.access(lib, 2L))
>>       stop("ERROR: no permission to install to directory ",
>>            sQuote(lib), call. = FALSE)
>>
>> The function .file_test() is defined earlier in the same file (it looks at
>> file.info(lib)$isdir) and appears to be intended to be the same as
>> utils:::file_test().
>>
>> You could start trying to figure out what the problem is by trying these
>> calls on the directory in question from an interactive R session.
>> (They seem to work as intended on my Windows system with a NetApp file
>> system mounted on a letter drive.)
>>
>> -- Tony Plate
>>
>> Kevin R. Coombes wrote:
>>>
>>> Hi,
>>>
>>> I have just updated R from version 2.8.1 to version 2.9.1.  I am running
>>> Windows XP Professional, Service Pack 3.
>>>
>>> With the update, I decided to update a set of packages that I maintain by
>>> compiling them for the new version.  Everything worked fine except for one
>>> package.  This package is unique (among the six I was working on) in that is
>>> stored on a UNIX-based file server that is exported to the Windows network
>>> via Samba.  The root of that network path is mapped to drive "N:" on the
>>> local machine.
>>>
>>> 'Rcmd check' fails for this package under 2.9.1.  The error message in
>>> '00install.out'  is:
>>> "Error: ERROR: no permission to install to directory
>>> 'N:/krc/Umpire/R-Package/Umpire.Rcheck'"
>>>
>>> 'Rcmd check' works for this package under 2.8.1.
>>>
>>> 'Rcmd check' works for this package if the directory is copied onto a
>>> local hard drive instead of the network drive.
>>>
>>> 'Rcmd build' and 'Rcmd build --binary' work under both versions.
>>>
>>> It would be nice if someone could figure out what has changed and fix
>>> it
>>>
>>> Best,
>>>   Kevin Coombes
>>>
>>> __
>>> 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
>

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


Re: [Rd] Improvement of [dpq]wilcox functions

2009-07-22 Thread Ivo Ugrina
Ivo Ugrina wrote:
> Hi,
> 
> I believe I have significantly improved [dpq]wilcox
> functions by implementing Harding's algorithm:
> Harding, E.F. (1984): An Efficient, Minimal-storage Procedure
> for Calculating the Mann-Whitney U, Generalized U and Similar
> Distributions, App. Statist., 33, 1-6
> 
> Results on my computer show (against R-2.9.1):
> 
>> system.time( dwilcox( 800, 800, 80) )
>user  system elapsed
>   0.240   0.180   0.443
>> system.time( dwilcox( (1:2800), 80, 80) )
>user  system elapsed
>   0.290   0.020   0.30
>> system.time( dwilcox( (1:2800), 160, 160) )
>user  system elapsed
>   0.810   0.060   0.868
>> system.time( dwilcox( (1:28000), 210, 210) )
>user  system elapsed
>  17.700   0.600  18.313
> RAM: ~ 700MB
>> system.time( pwilcox( 21000, 211, 211) )
>user  system elapsed
>  18.110   0.640  18.762
>> system.time( a <- qwilcox( 0.43, 200, 400) )
> ^C
> Timing stopped at: 14.39 1.43 18.794
> RAM: > 1.4GB at interrupt time
> 
>> system.time( dwilcox(800, 800, 80) )
>user  system elapsed
>   0.140   0.000   0.144
>> system.time( dwilcox( (1:2800), 80, 80) )
>user  system elapsed
>   0.010   0.000   0.007
>> system.time( dwilcox( (1:2800), 160, 160) )
>user  system elapsed
>   0.020   0.000   0.016
>> system.time( dwilcox( (1:28000), 210, 210) )
>user  system elapsed
>   0.050   0.000   0.05
> RAM: < 1MB
>> system.time( pwilcox( 21000, 211, 211) )
>user  system elapsed
>   0.020   0.000   0.025
>> system.time( a <- qwilcox( 0.43, 200, 400) )
>user  system elapsed
>   0.040   0.000   0.07
> RAM: < 1MB
> 
> There is no more need for
> wilcox_free at [dpq]wilcox in src/library/stats/distn.R
> (every other call after the first one with the same m,n
> will just read the results from the array so it will be
> really fast) and for
> #define WILCOX_MAX 50 in src/nmath/nmath.h
> 
> p.s. modified files are in the attachment
> 
> have fun,
> 

So is this an improvement or not?

-- 
Ivo Ugrina << http://web.math.hr/~iugrina >>
Teaching/Research Assistant at Department of Mathematics
University of Zagreb, Croatia

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


Re: [Rd] matrix algebra in c

2009-07-22 Thread Markus Jochmann

> 1. use F77_CALL() to call matrix multiplication functions from blas.
> This should be ok as long as I remember that c and FORTRAN store
> matrices differently.

Concerning 1. you might want to look at some C++ wrapper for BLAS and Lapack
like http://flens.sourceforge.net, this makes things easier.

-- 
View this message in context: 
http://www.nabble.com/matrix-algebra-in-c-tp24484891p24604315.html
Sent from the R devel mailing list archive at Nabble.com.

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


Re: [Rd] Rcmd check fails on Windows Samba network path in R 2.9.1

2009-07-22 Thread Kevin R. Coombes

Hi,

Thanks; that confirms that the problem originates where I thought it 
did, and provides a fix from within R.


However, the original problem was that running "Rcmd check" from a 
Windows/DOS command prompt on a package on a mounted Samba network drive 
fails.  The failure occurs because of the file.access call in 
"install.R", which appears to get incorrect information from the 
operating system.  Is it possible to get install.R changed so it works 
in this situation?


(Under the philosophy that "it is easier to beg forgiveness than to ask 
permission", perhaps install R should just try to create/write what it 
wants and only fail iby checking the result rather than 'asking 
permission")


Best,
   Kevin

Henrik Bengtsson wrote:

See r-devel thread '[Rd] file.access() on network (mounted) drive on
Windows Vista' on Nov 26, 2008:

  http://tolstoy.newcastle.edu.au/R/e5/devel/08/11/0806.html

where it was concluded that file.access() is "not 100%", e.g.
file.access() and file.info() can give different answers.

I added fileAccess(..., safe=TRUE) to R.utils, which imitates
file.access() but relies also on file.info() and file.exists() to
infer the rights.  It is still not 100% but (hopefully) closer than
file.access().

/H

On Tue, Jul 21, 2009 at 1:55 PM, Kevin R.
Coombes wrote:
  

Hi,

The problem almost certainly has something to do with Samba.  We also have a
NetApp file system, and copying the package source to that drive and running
Rcmd check from Windows works just fine.

When running the commands from an interactive R session, file_test returns
TRUE and file.access to test write permission indicates a failure, even
though that information is incorrect.Here is a session transcript:

-


getwd()
  

[1] "n:/krc/Umpire/R-Package"


lib <- "Umpire.Rcheck"
file_test("-d", lib)
  

[1] TRUE


file.access(lib, 2)
  

Umpire.Rcheck
 -1


dir.create(paste(lib, "testdir", sep='/'))
dir(lib)
  

[1] "00check.log"   "00install.out" "testdir" > sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

Again, this all worked (and still works) correctly in 2.8.1.

  Kevin

Tony Plate wrote:


This error message looks like it comes from src/library/tools/R/install.R,
which contains the following test:

  if (!.file_test("-d", lib) || file.access(lib, 2L))
  stop("ERROR: no permission to install to directory ",
   sQuote(lib), call. = FALSE)

The function .file_test() is defined earlier in the same file (it looks at
file.info(lib)$isdir) and appears to be intended to be the same as
utils:::file_test().

You could start trying to figure out what the problem is by trying these
calls on the directory in question from an interactive R session.
(They seem to work as intended on my Windows system with a NetApp file
system mounted on a letter drive.)

-- Tony Plate

Kevin R. Coombes wrote:
  

Hi,

I have just updated R from version 2.8.1 to version 2.9.1.  I am running
Windows XP Professional, Service Pack 3.

With the update, I decided to update a set of packages that I maintain by
compiling them for the new version.  Everything worked fine except for one
package.  This package is unique (among the six I was working on) in that is
stored on a UNIX-based file server that is exported to the Windows network
via Samba.  The root of that network path is mapped to drive "N:" on the
local machine.

'Rcmd check' fails for this package under 2.9.1.  The error message in
'00install.out'  is:
"Error: ERROR: no permission to install to directory
'N:/krc/Umpire/R-Package/Umpire.Rcheck'"

'Rcmd check' works for this package under 2.8.1.

'Rcmd check' works for this package if the directory is copied onto a
local hard drive instead of the network drive.

'Rcmd build' and 'Rcmd build --binary' work under both versions.

It would be nice if someone could figure out what has changed and fix
it

Best,
  Kevin Coombes

__
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




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


[Rd] Link to documentation in another package

2009-07-22 Thread ONKELINX, Thierry
Dear all,

One of the functions that I wrote (ggsave.latex) extents the
functionality of a function (ggsave) in another package (ggplot2).
Instead of copying all the information I would like to create a link in
the helpfile of ggsave.latex to the helpfile of ggsave. I tried
\code{\link{ggsave}} and \code{\link{ggplot2::ggsave}}, but neither
worked. Both cases gave a 'missing link' warning.

Any suggestions?

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and 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


Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

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


Re: [Rd] Link to documentation in another package

2009-07-22 Thread Nicholas L Crookston
Try this:  \code{\link[ggplot2]{ggsave}}


Nicholas L. Crookston, Operations Research Analyst
Rocky Mountain Research Station
USDA Forest Service
1221 South Main, Moscow, ID 83843
Office: (208) 883-2317, FAX: (208) 883-2318
EMail: ncrooks...@fs.fed.us



"ONKELINX, Thierry"  
Sent by: r-devel-boun...@r-project.org
07/22/2009 06:55 AM

To

cc

Subject
[Rd] Link to documentation in another package





Dear all,

One of the functions that I wrote (ggsave.latex) extents the
functionality of a function (ggsave) in another package (ggplot2).
Instead of copying all the information I would like to create a link in
the helpfile of ggsave.latex to the helpfile of ggsave. I tried
\code{\link{ggsave}} and \code{\link{ggplot2::ggsave}}, but neither
worked. Both cases gave a 'missing link' warning.

Any suggestions?

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and 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


Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver 
weer
en binden het INBO onder geen enkel beding, zolang dit bericht niet 
bevestigd is
door een geldig ondertekend document. The views expressed in  this message
and any annex are purely those of the writer and may not be regarded as 
stating
an official position of INBO, as long as the message is not confirmed by a 
duly
signed document.

__
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


[Rd] maximum supported lag is 350

2009-07-22 Thread Matteo Bertini

I have found a strange error:

> fit = Arima(flow, c(1,0,1), list(order=c(0,1,1), period=96*7))
Error in makeARIMA(trarma[[1L]], trarma[[2L]], Delta, kappa) :
  maximum supported lag is 350

Is in fact quite common to have a lag > 350 using a weekly period in 
15min steps = 672 (standard in traffic flow prediction litterature for 
example).


Is there any reasons against doing what is suggested in the comment and 
avoid the hardcoded limit?


Thanks,
Matteo Bertini



# https://svn.r-project.org/R/trunk/src/library/stats/src/arima.c
SEXP getQ0(SEXP sPhi, SEXP sTheta)
{

[8<]

/* This is the limit using an int index.  We could use
   size_t and get more on a 64-bit system,
   but there seems no practical need. */
if(r > 350) error(_("maximum supported lag is 350"));

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


Re: [Rd] Rcmd check fails on Windows Samba network path in R 2.9.1

2009-07-22 Thread Duncan Murdoch

On 7/22/2009 9:10 AM, Kevin R. Coombes wrote:

Hi,

Thanks; that confirms that the problem originates where I thought it 
did, and provides a fix from within R.


However, the original problem was that running "Rcmd check" from a 
Windows/DOS command prompt on a package on a mounted Samba network drive 
fails.  The failure occurs because of the file.access call in 
"install.R", which appears to get incorrect information from the 
operating system.  Is it possible to get install.R changed so it works 
in this situation?



Of course that's possible, but I'd put it at a low priority.  The right 
solution here is to fix Samba.  A simple workaround is to copy the 
package to a non-Samba drive.  Since this is not our bug, and it has a 
simple workaround, I don't want to put an effort into fixing it.


Duncan Murdoch



(Under the philosophy that "it is easier to beg forgiveness than to ask 
permission", perhaps install R should just try to create/write what it 
wants and only fail iby checking the result rather than 'asking 
permission")


Best,
Kevin

Henrik Bengtsson wrote:

See r-devel thread '[Rd] file.access() on network (mounted) drive on
Windows Vista' on Nov 26, 2008:

  http://tolstoy.newcastle.edu.au/R/e5/devel/08/11/0806.html

where it was concluded that file.access() is "not 100%", e.g.
file.access() and file.info() can give different answers.

I added fileAccess(..., safe=TRUE) to R.utils, which imitates
file.access() but relies also on file.info() and file.exists() to
infer the rights.  It is still not 100% but (hopefully) closer than
file.access().

/H

On Tue, Jul 21, 2009 at 1:55 PM, Kevin R.
Coombes wrote:
  

Hi,

The problem almost certainly has something to do with Samba.  We also have a
NetApp file system, and copying the package source to that drive and running
Rcmd check from Windows works just fine.

When running the commands from an interactive R session, file_test returns
TRUE and file.access to test write permission indicates a failure, even
though that information is incorrect.Here is a session transcript:

-


getwd()
  

[1] "n:/krc/Umpire/R-Package"


lib <- "Umpire.Rcheck"
file_test("-d", lib)
  

[1] TRUE


file.access(lib, 2)
  

Umpire.Rcheck
 -1


dir.create(paste(lib, "testdir", sep='/'))
dir(lib)
  

[1] "00check.log"   "00install.out" "testdir" > sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

Again, this all worked (and still works) correctly in 2.8.1.

  Kevin

Tony Plate wrote:


This error message looks like it comes from src/library/tools/R/install.R,
which contains the following test:

  if (!.file_test("-d", lib) || file.access(lib, 2L))
  stop("ERROR: no permission to install to directory ",
   sQuote(lib), call. = FALSE)

The function .file_test() is defined earlier in the same file (it looks at
file.info(lib)$isdir) and appears to be intended to be the same as
utils:::file_test().

You could start trying to figure out what the problem is by trying these
calls on the directory in question from an interactive R session.
(They seem to work as intended on my Windows system with a NetApp file
system mounted on a letter drive.)

-- Tony Plate

Kevin R. Coombes wrote:
  

Hi,

I have just updated R from version 2.8.1 to version 2.9.1.  I am running
Windows XP Professional, Service Pack 3.

With the update, I decided to update a set of packages that I maintain by
compiling them for the new version.  Everything worked fine except for one
package.  This package is unique (among the six I was working on) in that is
stored on a UNIX-based file server that is exported to the Windows network
via Samba.  The root of that network path is mapped to drive "N:" on the
local machine.

'Rcmd check' fails for this package under 2.9.1.  The error message in
'00install.out'  is:
"Error: ERROR: no permission to install to directory
'N:/krc/Umpire/R-Package/Umpire.Rcheck'"

'Rcmd check' works for this package under 2.8.1.

'Rcmd check' works for this package if the directory is copied onto a
local hard drive instead of the network drive.

'Rcmd build' and 'Rcmd build --binary' work under both versions.

It would be nice if someone could figure out what has changed and fix
it

Best,
  Kevin Coombes

__
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




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

Re: [Rd] Link to documentation in another package

2009-07-22 Thread ONKELINX, Thierry
Thanks. That did solve my problem.
 



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and 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
  





Van: Nicholas L Crookston [mailto:ncrooks...@fs.fed.us] 
Verzonden: woensdag 22 juli 2009 16:10
Aan: ONKELINX, Thierry
CC: r-devel@r-project.org; r-devel-boun...@r-project.org
Onderwerp: Re: [Rd] Link to documentation in another package



Try this:  \code{\link[ggplot2]{ggsave}} 


Nicholas L. Crookston, Operations Research Analyst
Rocky Mountain Research Station
USDA Forest Service
1221 South Main, Moscow, ID 83843
Office: (208) 883-2317, FAX: (208) 883-2318
EMail: ncrooks...@fs.fed.us 



"ONKELINX, Thierry"  
Sent by: r-devel-boun...@r-project.org 

07/22/2009 06:55 AM 

To
 
cc
Subject
[Rd] Link to documentation in another package





Dear all,

One of the functions that I wrote (ggsave.latex) extents the
functionality of a function (ggsave) in another package (ggplot2).
Instead of copying all the information I would like to create a link in
the helpfile of ggsave.latex to the helpfile of ggsave. I tried
\code{\link{ggsave}} and \code{\link{ggplot2::ggsave}}, but neither
worked. Both cases gave a 'missing link' warning.

Any suggestions?

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and 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


Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver
weer
en binden het INBO onder geen enkel beding, zolang dit bericht niet
bevestigd is
door een geldig ondertekend document. The views expressed in  this
message
and any annex are purely those of the writer and may not be regarded as
stating
an official position of INBO, as long as the message is not confirmed by
a duly
signed document.

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



Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

[[alternative HTML version deleted]]

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


Re: [Rd] Rcmd check fails on Windows Samba network path in R 2.9.1

2009-07-22 Thread Simon Urbanek


On Jul 22, 2009, at 10:28 , Duncan Murdoch wrote:


On 7/22/2009 9:10 AM, Kevin R. Coombes wrote:

Hi,
Thanks; that confirms that the problem originates where I thought  
it did, and provides a fix from within R.
However, the original problem was that running "Rcmd check" from a  
Windows/DOS command prompt on a package on a mounted Samba network  
drive fails.  The failure occurs because of the file.access call in  
"install.R", which appears to get incorrect information from the  
operating system.  Is it possible to get install.R changed so it  
works in this situation?



Of course that's possible, but I'd put it at a low priority.  The  
right solution here is to fix Samba.  A simple workaround is to copy  
the package to a non-Samba drive.  Since this is not our bug, and it  
has a simple workaround, I don't want to put an effort into fixing it.




It *is* our bug - this happens on other drives, too, not just samba  
(see my "R CMD check failing due to unreliable file.access() on  
Windows" post from 7/2 on R-core about this) - hence your advice is  
quite far off. Also note that other tools have no issue finding the  
correct flags. I thought this is being worked on (according to that  
thread)... I'm not saying that file.access() can be fixed easily  
(essentially you have to deal with GetFileSecurityW returning  
ERROR_NOT_SUPPORTED and use the GetFileAttributesW result or something  
similar instead), but check surely can use the same old reality-based  
check that it used before 2.9.0.


Cheers,
Simon




Duncan Murdoch

(Under the philosophy that "it is easier to beg forgiveness than to  
ask permission", perhaps install R should just try to create/write  
what it wants and only fail iby checking the result rather than  
'asking permission")

Best,
   Kevin
Henrik Bengtsson wrote:

See r-devel thread '[Rd] file.access() on network (mounted) drive on
Windows Vista' on Nov 26, 2008:

 http://tolstoy.newcastle.edu.au/R/e5/devel/08/11/0806.html

where it was concluded that file.access() is "not 100%", e.g.
file.access() and file.info() can give different answers.

I added fileAccess(..., safe=TRUE) to R.utils, which imitates
file.access() but relies also on file.info() and file.exists() to
infer the rights.  It is still not 100% but (hopefully) closer than
file.access().

/H

On Tue, Jul 21, 2009 at 1:55 PM, Kevin R.
Coombes wrote:


Hi,

The problem almost certainly has something to do with Samba.  We  
also have a
NetApp file system, and copying the package source to that drive  
and running

Rcmd check from Windows works just fine.

When running the commands from an interactive R session,  
file_test returns
TRUE and file.access to test write permission indicates a  
failure, even

though that information is incorrect.Here is a session transcript:

-


getwd()


[1] "n:/krc/Umpire/R-Package"


lib <- "Umpire.Rcheck"
file_test("-d", lib)


[1] TRUE


file.access(lib, 2)


Umpire.Rcheck
-1


dir.create(paste(lib, "testdir", sep='/'))
dir(lib)


[1] "00check.log"   "00install.out" "testdir" > sessionInfo()
R version 2.9.1 (2009-06-26)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods
base


Again, this all worked (and still works) correctly in 2.8.1.

 Kevin

Tony Plate wrote:

This error message looks like it comes from src/library/tools/R/ 
install.R,

which contains the following test:

 if (!.file_test("-d", lib) || file.access(lib, 2L))
 stop("ERROR: no permission to install to directory ",
  sQuote(lib), call. = FALSE)

The function .file_test() is defined earlier in the same file  
(it looks at

file.info(lib)$isdir) and appears to be intended to be the same as
utils:::file_test().

You could start trying to figure out what the problem is by  
trying these

calls on the directory in question from an interactive R session.
(They seem to work as intended on my Windows system with a  
NetApp file

system mounted on a letter drive.)

-- Tony Plate

Kevin R. Coombes wrote:


Hi,

I have just updated R from version 2.8.1 to version 2.9.1.  I  
am running

Windows XP Professional, Service Pack 3.

With the update, I decided to update a set of packages that I  
maintain by
compiling them for the new version.  Everything worked fine  
except for one
package.  This package is unique (among the six I was working  
on) in that is
stored on a UNIX-based file server that is exported to the  
Windows network
via Samba.  The root of that network path is mapped to drive  
"N:" on the

local machine.

'Rcmd check' fails for this package under 2.9.1.  The error  
message in

'00install.out'  is:
"Error: ERROR: no permission to install to directory
'N:/krc/Umpire/R-Package/Umpire

Re: [Rd] Improvement of [dpq]wilcox functions

2009-07-22 Thread Olaf Mersmann
Hi Ivo,

Excerpts from Ivo Ugrina's message of Thu Jul 09 17:05:27 +0200 2009:
> I believe I have significantly improved [dpq]wilcox
> functions by implementing Harding's algorithm:
> Harding, E.F. (1984): An Efficient, Minimal-storage Procedure
> for Calculating the Mann-Whitney U, Generalized U and Similar
> Distributions, App. Statist., 33, 1-6

I've looked at your code and it is indeed quite a bit faster. Sadly in
some cases it produces inaccurate results. See for example:

R 2.9.1:
  > sum(dwilcox(1:(500*100), 500, 100))
  [1] 1

R 2.9.1 + your patch:
  > sum(dwilcox(1:(500*100), 500, 100))
  [1] 1.001377
  > sum(dwilcox(1:(500*200), 500, 200))
  [1] -132443.2
  > sum(dwilcox(1:(1000*200), 1000, 200))
  [1] 3.412391e+13

The last two examples run out of memory on my machine in an unpatched
R. I think if you can sort out the numerical issuses your patch would
be interesting since it is indeed quite a bit faster than the current
implementation.

Cheers,
Olaf Mersmann

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


[Rd] inclusion of a new bandwidth selector for kernel density estimation in R stats

2009-07-22 Thread Jason Liao
I understand that Prof. Ripley is largely responsible for the many
kernel density estimation functions in R, especially the bw.SJ functions
for the popular Sheather and Jones bandwidth selector. We have recently
developed a new bandwidth selector that significantly improves SJ
selector for difficult densities that deviates severely from normality
but retains the superior performance of SJ selector for smoother ones.
The paper (to appear in Journal of nonparametric statistics) is
available at

 

http://www.geocities.com/jg_liao/papers/kernel.pdf

 

and the R function bw.liao is at

 

http://www.geocities.com/jg_liao/software/bw_liao.txt

 

The algorithm and R function appears to be very stable as it has
processed more than 2 datasets without problem. We would love to
work with Prof. Ripley or other R core member to make the new method
part of R stats. Thanks.

 

Jason

 

Jason Liao, http://www.geocities.com/jg_liao 

 


[[alternative HTML version deleted]]

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


[Rd] ks.test - The two-sample two-sided Kolmogorov-Smirnov test with ties (PR#13848)

2009-07-22 Thread tpw
Full_Name: Thomas Waterhouse
Version: 2.9.1
OS: OS X 10.5.7
Submission from: (NULL) (216.239.45.4)


ks.test uses a biased approximation to the p-value in the case of the two-sample
test with ties in the pooled data.  This has been justified in R in the past by
the argument that the KS test assumes a continuous distribution.  But the
two-sample test can be extended to arbitrary distributions by a combinatorial
argument (below), which I would like to see implemented in R.

The p-value of the test is simply the probability that a random assignment of
the pooled data to two sets of the sizes of the input data sets has a KS test
statistic at least as great as that of the input data.  The function psmirnov2x
in ks.c calculates this probability by enumerating all such assignments as
lattice walks, except that it doesn't know how to handle tied data points.

The correct procedure can be deduced by considering that steps in such lattice
walks represent steps along the x-axis in computing the empirical CDFs of the
two data sets.  The trick is to consider all occurrences of a repeated data
point together, when determining whether a path exceeds the input statistic or
not.  A FORTRAN implementation of this algorithm was published by Nikiforov
(http://www.ams.sunysb.edu/~nkfr/5PUBL.HTM), but it's not for the faint of
heart.

It would be straightforward to change psmirnov2x to include this logic, but I
found it easier simply to rewrite it (with comments this time!) as follows:

void
psmirnov2x(double *x, Sint *m, Sint *n, double *pool)
{
/* Inputs:  *x is the value of the KS test statistic (from 0.0 to 1.0)
*m and *n are the lengths of each data set
*pool is an array of length *m + *n formed by combining the two
data sets and sorting in increasing order
   Output:  *x is unity minus the p-value of the test
   Notes: The p-value of the two-sample KS test is the proportion of all
assignments of the pooled data to sets of sizes *m and *n which
have test statistic exceeding the test statistic of the actual
data.
  To calculate this, we interpret each assignment as a lattice walk
from the origin to (*m, *n), where the i-th step represents the
i-th
data point in the pooled data set.  A step to the right represents
assigning a data point to the *m set, and a step up represents
assigning a data point to the *n set.  The difference between the
empirical CDFs of each set can be computed at each step, and the
KS test statistic is simply the maximum of this value along a given
walk.
  The p-value is obtained by counting the number of walks that do
not exceed the input value (since this is easier than counting the
number that do) and dividing by the total number of walks; this is
what we return to the caller.
  If the same value occurs multiple times in the pooled data, we
need to count all multiplicites at the same time when computing the
empirical CDFs.  In terms of the lattice walk, this means we look
only the final occurence of each value when determining whether or
not a walk exceeds the input statistic.
 */
double md, nd, q, *u, w;
Sint i, j;

if (*x == 0.0) {
return 1.0;
}

md = (double) (*m);
nd = (double) (*n);
q = floor(*x * md * nd - 1e-7) / (md * nd);  /* just *x minus an epsilon */
u = (double *) R_alloc(*n + 1, sizeof(double));

for (i = 0; i <= *m; i++) {
for (j = 0; j <= *n; j++) {
/* At each step, rescale by w := j/(j+*m); this is equivalent to
   dividing by C(*m+*n, *m) at the end, but without the risk of
   overflow */
w = (double)(j) / (double)(j + *m);
if (i + j == 0) {
/* Start with 1 walk from the origin to the origin */
u[j] = 1.0;
} else if (i + j < *m + *n &&
   pool[i + j - 1] != pool[i + j] &&
   fabs(i / md - j / nd) > q) {
/* This walk meets or exceeds *x, so don't count it */
u[j] = 0.0;
} else if (i == 0) {
/* The *n-edge:  The number of walks to (0, j) is the same as
   the number of walks to (0, j-1) */
u[j] = u[j - 1] * w;
} else if (j == 0) {
/* The *m-edge:  The number of walks to (i, 0) is the same as
   the number of walks to (i-1, 0) */
/* no-op */
} else {
/* The general case:  The number of walks to (i, j) is the
   number of walks to (i-1, j) plus the number of walks to
   (i, j-1) */
u[j] = u[j] + u[j - 1] * w;
}
}
}
/* Return the proportion of walks that do not exceed the