[Rd] Avoid warning in a foreign package (maptools) when loaded via depends

2010-11-11 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Hi everybody,

 

Currently I'm in the process of developing an R library, where I make
use of  "pointLabel" in the "maptools" package. I've defined the
dependency on package "maptools" via the DESCRIPTION file in the root
directory of my library.

 

Since the loading of package "maptools" issues a warning, "R CMD check"
complains about this uncaught warning:

 

> library(maptools)

Loading required package: foreign

Loading required package: sp

 

Attaching package: 'maptools'

 

 

The following object(s) are masked from package:sp :

 

 spChFIDs 

 

Warning message:

Multiple methods tables found for 'spChFIDs'

 

If I tried to circumvent this warning in usual  R code, I would do
something like

 

suppressWarning(library(maptools)) 

 

However, this is not an option as the library is loaded via the depends
command.

 

Can anybody advise me what do do?

 

Thanks + BR,

 

Thorn


[[alternative HTML version deleted]]

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


[Rd] Reminder Special issue of the JSS on Graphical User Interfaces for R

2010-11-11 Thread Pedro Valero-Mora
Special issue of the Journal of Statistical Software on

Graphical User Interfaces for R

Editors: Pedro Valero-Mora and Rubén Ledesma

Along its almost 15 years of existence, R has managed to gain an 
ever-increasing percentage of academic and professional statisticians 
but the spread of its use among novice and occasional users of 
statistics have not progressed at the same pace. Among the reasons for 
this relative lack of impact, the lack of a GUI or point and click 
interface is one of the causes most widely mentioned. But, however, in 
the last few years, this situation has been quietly changing and a 
number of projects have equipped R with a number of different GUIs, 
ranging from the very simple to the more advanced, and providing the 
casual user with what could be still a new source of trouble: choosing 
what is the GUI for him. We may have moved from the "too few" situation 
to the "too many" situation.

This special issue of the JSS intends as one of its main goals to offer 
a general overview of the different GUIs currently available for R. 
Thus, we think that somebody trying to find its way among different 
alternatives may find useful it as starting point. However, we do not 
want to stop in a mere listing but we want to offer a bit of a more 
general discussion about what would be the ideal GUI for R (and how to 
build it). Therefore, we want to see papers submitted that discuss the 
whole concept of GUI in R, what elements it should include (or not), how 
this could be achieved, and, why not, if it is actually needed at all. 
Finally, despite the high success of R, this does not mean other systems 
may not treasure important features that we would like to see in R. 
Indeed, descriptions of these nice features that we do not have in R but 
are in other systems could be another way of driving the future progress 
of GUIs for R.

In summary, we envision papers for this special issue on GUIs for R in 
the following categories:

-General discussions on GUIs for statistics, and for R.

-Implementing GUI toolboxes for R so others can program GUIs with them.

-R GUIs examples (with two subcategories, in the desktop or in the cloud).

-Is there life beyond R? What features have other systems that R does 
not have and why R needs them.

Papers can be sent directly to Pedro Valero-Mora (vale...@uv.es 
) or Ruben Ledesma (rdlede...@gmail.com 
) and they will follow the usual JSS 
reviewing procedure. Initial deadline is December 2010 with final 
versions published along 2011.


-- 
Dr. Pedro M. Valero Mora (vale...@uv.es)
Facultad de Psicología
Universitat de Valencia
Mob. 669842979 Ext.93564
http://www.uv.es/valerop

SINTEC-INTRAS
Driving Simulation and Human Factors of New Technologies in the Vehicle
Institute of Traffic and Road Safety
Tlf. (34) 96 3393880 (Interno: 93910)
http://www.uv.es/sintec

METHODOLOGY OF BEHAVIOURAL SCIENCES
Data Visualization and Computational Statistics
Tlf. (34) 96 3983564 (Interno: 83564)
http://www.uv.es/visualstats/Book/
http://www.uv.es/prodat

CHECK THE VISUAL STATISTICS BOOK!
http://www.uv.es/visualstats/Book/


[[alternative HTML version deleted]]

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


[Rd] S4 setMethod, setGeneric and default arguments

2010-11-11 Thread evilphil

Hi Guys

I have defined a generic function, for which one of the arguments has a
default:

setGeneric( "getFwdRate",
  function(.Object, tenorFrom, tenorTo=tenorFrom)
standardGeneric("getFwdRate")
  )

Then I have defined a method which also has a default:

setMethod( "getFwdRate", signature(.Object="CCurveVector",
tenorFrom="numeric", tenorTo="numeric"),
  function(.Object, tenorFrom, tenorTo=tenorFrom+1) {
[REMOVED IRRELEVANT IMPLEMENTATION
  }
  )

However, if I call

getFwdRate(thisYC, 1)

I get "Error in function (classes, fdef, mtable)  :  unable to find an
inherited method for function "getFwdRate", for signature "CCurveVector",
"numeric", "missing" "

Is there a way that this call would match the method I've defined? Or do I
need to declare a duplicate method with signature(.Object="CCurveVector",
tenorFrom="numeric", tenorTo="missing")? In which case what is the point of
having default arguments in the method declaration?

thanks
Phil
-- 
View this message in context: 
http://r.789695.n4.nabble.com/S4-setMethod-setGeneric-and-default-arguments-tp3037716p3037716.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] callNextMethod fails with "$" generic

2010-11-11 Thread Vitalie S.
John Chambers  writes:

> The problem here is that the primitive for `$` does not use standard R
> evaluation on its second argument, so when it is selected as the next method
> the call is effectively x$name regardless of the original call.
>
> If possible, I would avoid such cascaded calls of methods for `$`, precisely
> because of the nonstandard evaluation, which makes the interpretation of each
> level of the call ambiguous.
>
> If this kind of code is needed, then the primitive method  should get a call
> in which the literal name is in place and the object has been coerced
> suitably.
>
> In this example, something like
>
>> setMethod("$", "mylist", function(x, name) {
> + theName <- substitute(name)
> + expr <- substitute(xx$NAME, list(NAME = theName))
> + xx <- unclass(x)
> + eval(expr)
> + })
> [1] "$"
>> tl <- new("mylist")
>> tl[["z"]] <- 1
>> tl$z
> [1] 1

Thank you,  that helps.

>
> On 11/10/10 4:49 AM, Vitalie S. wrote:
>> Dear Developers,
>>
>> callNextMethods does not work with "$"
>>
>> setClass("mylist", contains = "list"):
>> setMethod("$",
>>signature(x = "mylist"),
>>function (x, name){
>>cat("here:\n")
>>callNextMethod()
>>})
>>
>> tl<- new("mylist")
>> tl[["x"]]<- 343
>>
>> tl$x
>> #here:
>> #NULL
>>
>>
>> If I use callNextMethod(x=x, name=name)
>>
>> this error is issued:
>>
>> Error in function (classes, fdef, mtable)  :
>> unable to find an inherited method for function "addNextMethod", for
> signature "function"
>>
>> It must be something "$" specific. If the above is an expected behavior ,
> how
>> should I call next method for "$" generic?
>>
>> My info:
>> R version 2.12.0 Patched (2010-11-01 r53513)
>> Platform: i386-pc-mingw32/i386 (32-bit)
>>
>> Same behavior for official R 2.12.0.
>>
>> Thanks,
>> Vitalie.
>>
>> __
>> 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] Evaluation puzzle

2010-11-11 Thread Terry Therneau
The survexp function can fail when called from another function.  The "why" of
this has me baffled, however.

Here is a simple test case, using a very stripped down version of survexp:

survexp.test <- function(formula, data,
weights, subset, na.action, rmap, 
times,  cohort=TRUE,  conditional=FALSE,
ratetable=survexp.us, scale=1, npoints, se.fit,
model=FALSE, x=FALSE, y=FALSE) {
call <- match.call()
m <- match.call(expand.dots=FALSE)

# keep the first element (the call), and the following selected arguments
m <- m[c(1, match(c('formula', 'data', 'weights', 'subset', 'na.action'),
  names(m), nomatch=0))]
m[[1]] <- as.name("model.frame")

# Add in the ratetable variables
varlist <- attr(ratetable, 'dimid')
tform <- paste(deparse(formula), paste(varlist, collapse='+'), sep='+')
m$formula <- tform

print(m)
print(ls(parent.frame()))
mf <- eval(m, parent.frame())

names(mf)
}

Here is the test data

tdata <- data.frame(age= c(12, 24, 36)*365.25, sex=c(1,2,1),
year=as.Date('1953/03/10', '1960/02/23', '1978/09.22'))
tfun <- function(mydata) {
 zed <- 100 + (1:nrow(mydata)) * 20
 survexp.test(zed ~ 1, data=mydata)
 }

And the result of the exercise.

% R --vanilla
R version 2.11.0 (2010-04-22)

> library(survival)# to pick up the survexp.us data
> tfun(tdata)
model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
[1] "mydata" "zed"   
Error in eval(expr, envir, enclos) : object 'zed' not found

-
 Eval is being called with the expression shown and an environment that 
contains the relevant variables in that expression: zed and mydata.  Yet it
fails to find the variable zed.

 I don't see anything relevant in the manual pages for either eval or
model.frame.  I suspect that there is an invisible, undocumented, magic
argument somewhere.  


My second problem is a puzzler:

> options(error=recover)
> tfun(tdata)
model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
[1] "mydata" "zed"   
Error in eval(expr, envir, enclos) : object 'zed' not found

Enter a frame number, or 0 to exit   

1: tfun(tdata)
2: survexp.test(zed ~ 1, data = mydata)
3: eval(m, parent.frame())
4: eval(expr, envir, enclos)
5: model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
6: model.frame.default(formula = "zed ~ 1+age+sex+year", data = mydata)
7: eval(predvars, data, env)
8: eval(expr, envir, enclos)

Selection: 2
Called from: model.frame.default(formula = "zed ~ 1+age+sex+year", data = 
mydata)


 Why does selecting "2" result in going to frame "6"?

Terry Therneau

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


Re: [Rd] Evaluation puzzle

2010-11-11 Thread Gabor Grothendieck
On Thu, Nov 11, 2010 at 3:08 PM, Terry Therneau  wrote:
> The survexp function can fail when called from another function.  The "why" of
> this has me baffled, however.
>
> Here is a simple test case, using a very stripped down version of survexp:
>
> survexp.test <- function(formula, data,
>        weights, subset, na.action, rmap,
>        times,  cohort=TRUE,  conditional=FALSE,
>        ratetable=survexp.us, scale=1, npoints, se.fit,
>        model=FALSE, x=FALSE, y=FALSE) {
>    call <- match.call()
>    m <- match.call(expand.dots=FALSE)
>
>    # keep the first element (the call), and the following selected arguments
>    m <- m[c(1, match(c('formula', 'data', 'weights', 'subset', 'na.action'),
>                      names(m), nomatch=0))]
>    m[[1]] <- as.name("model.frame")
>
>    # Add in the ratetable variables
>    varlist <- attr(ratetable, 'dimid')
>    tform <- paste(deparse(formula), paste(varlist, collapse='+'), sep='+')

At the above statement you have lost the environment of your formula.

>    m$formula <- tform

Replace this with:

m$formula <- as.formula(tform, environment(formula))



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] Evaluation puzzle

2010-11-11 Thread Terry Therneau
Gabor wrote: 
 At the above statement you have lost the environment of your formula.

>m$formula <- tform

Replace this with:

m$formula <- as.formula(tform, environment(formula))

--
  No, I have not "lost" an environment.  I manufactured a formula which
lacked something needed, but without the necessary hint that I needed
it. But that is semantics:  A closer reread of help(model.frame) shows
that the documentation is there, I had missed it.
  
 I'm still puzzled by recover though.

Terry T.

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


Re: [Rd] Evaluation puzzle

2010-11-11 Thread Kevin R. Coombes

Hi Terry,

This may not really be a complete answer, but there seems to be a 
difference in eval'ing an expression compared to eval'ing a call (even 
though both are documented in the help page for eval as working just fine).


If you insert the line
print(eval(expression(zed), parent.frame()))
into your survexp.test function just above the existing call to "eval", 
this line works just fine.  So it's clear that an _expression_ 
containing "zed" can be evaluated, but evaluating the _call_  via the 
model.frame function fails.


I suspect that the actual evaluation problem lies in the call to
eval(predvars, data, env)
made inside model.frame.default.   The value of "env" when this function 
is called is defined in an earlier line by

env <- environment(formula)
Since the formula does not have an environment defined when it is passed 
in, one gets provided within the model.frame.default function.  I edited 
my version of model.frame.default to

print(ls(env))
just before the call to
eval(predvars, data, env)
and confirmed that "zed" is not part of that environment.

Now the manual page for formula says that "Formulas created with ~ use 
the environment in which they were created. Formulas created with 
'as.formula' use the env argument for their environment."  Since you are 
passing a character string through to model.frame, and it calls 
"as.formula" without an environment, the formula eventually gets 
evaluated in the context of the model.frame.default function without 
knowing about the environment you gave it.


I think you can fix this by explicitly creating your own 
formula+environment before calling miodel frame.  Specifically, try 
changing the line

m$formula <- tform
to
m$formula <- as.formula(tform, env=parent.frame())
and see if that helps.  On my machine, it at least allows
tfun(tdata)
to run without throwing an error.

Best,
Kevni


On 11/11/2010 2:08 PM, Terry Therneau wrote:

The survexp function can fail when called from another function.  The "why" of
this has me baffled, however.

Here is a simple test case, using a very stripped down version of survexp:

survexp.test<- function(formula, data,
 weights, subset, na.action, rmap,
 times,  cohort=TRUE,  conditional=FALSE,
 ratetable=survexp.us, scale=1, npoints, se.fit,
 model=FALSE, x=FALSE, y=FALSE) {
 call<- match.call()
 m<- match.call(expand.dots=FALSE)

 # keep the first element (the call), and the following selected arguments
 m<- m[c(1, match(c('formula', 'data', 'weights', 'subset', 'na.action'),
   names(m), nomatch=0))]
 m[[1]]<- as.name("model.frame")

 # Add in the ratetable variables
 varlist<- attr(ratetable, 'dimid')
 tform<- paste(deparse(formula), paste(varlist, collapse='+'), sep='+')
 m$formula<- tform

 print(m)
 print(ls(parent.frame()))
 mf<- eval(m, parent.frame())

 names(mf)
 }

Here is the test data

tdata<- data.frame(age= c(12, 24, 36)*365.25, sex=c(1,2,1),
 year=as.Date('1953/03/10', '1960/02/23', '1978/09.22'))
tfun<- function(mydata) {
  zed<- 100 + (1:nrow(mydata)) * 20
  survexp.test(zed ~ 1, data=mydata)
  }

And the result of the exercise.

% R --vanilla
R version 2.11.0 (2010-04-22)


library(survival)# to pick up the survexp.us data
tfun(tdata)

model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
[1] "mydata" "zed"
Error in eval(expr, envir, enclos) : object 'zed' not found

-
  Eval is being called with the expression shown and an environment that
contains the relevant variables in that expression: zed and mydata.  Yet it
fails to find the variable zed.

  I don't see anything relevant in the manual pages for either eval or
model.frame.  I suspect that there is an invisible, undocumented, magic
argument somewhere.


My second problem is a puzzler:


options(error=recover)
tfun(tdata)

model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
[1] "mydata" "zed"
Error in eval(expr, envir, enclos) : object 'zed' not found

Enter a frame number, or 0 to exit

1: tfun(tdata)
2: survexp.test(zed ~ 1, data = mydata)
3: eval(m, parent.frame())
4: eval(expr, envir, enclos)
5: model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
6: model.frame.default(formula = "zed ~ 1+age+sex+year", data = mydata)
7: eval(predvars, data, env)
8: eval(expr, envir, enclos)

Selection: 2
Called from: model.frame.default(formula = "zed ~ 1+age+sex+year", data = 
mydata)


  Why does selecting "2" result in going to frame "6"?

Terry Therneau

__
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] Evaluation puzzle

2010-11-11 Thread Gabor Grothendieck
On Thu, Nov 11, 2010 at 5:27 PM, Terry Therneau  wrote:
> Gabor wrote:
>  At the above statement you have lost the environment of your formula.
>
>>    m$formula <- tform
>
> Replace this with:
>
> m$formula <- as.formula(tform, environment(formula))
>
> --
>  No, I have not "lost" an environment.  I manufactured a formula which

You manufactured a "character" string, not a "formula", and character
strings don't have environments.

> lacked something needed, but without the necessary hint that I needed
> it. But that is semantics:  A closer reread of help(model.frame) shows
> that the documentation is there, I had missed it.
>
>  I'm still puzzled by recover though.
>
> Terry T.
>
>



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] Evaluation puzzle

2010-11-11 Thread Terry Therneau
Kevin,
  The answer came from Gabor -- the model.frame function has a
non-standard evaluation, in that it uses the enviromnent attached to the
formula as the "enclosure" for looking up variable names.
  This is clearly documented and I somehow missed it when reading the
page.  So "reading deficit" is the true root of my query.  I scratched
my head for a couple of hours before sending for help. 

   Also a typo in my stripped down example -- I forgot the as.formula()
wrapper which is in the actual survexp function.  This added a red
herring to the discussion.

Terry T.

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


Re: [Rd] Evaluation puzzle

2010-11-11 Thread Peter Dalgaard
On 11/11/2010 11:27 PM, Terry Therneau wrote:

>  I'm still puzzled by recover though.

It looks like a buglet. You get to the right frame (try ls()) but the
"called from" message is off by four frames.

E.g.

Selection: 1
Called from: model.frame(formula = "zed ~ 1+age+sex+year", data = mydata)
Browse[1]> ls()
[1] "mydata" "zed"
Browse[1]> tfun
function(mydata) {
 zed <- 100 + (1:nrow(mydata)) * 20
 survexp.test(zed ~ 1, data=mydata)
 }

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


Re: [Rd] installed.packages Error: subscript out of bounds

2010-11-11 Thread Hervé Pagès

I can see this has been addressed, thanks!

I found a couple more issues with installed.packages().

The values returned in the Archs column don't seem to really make
sense on Unix:

  > installed.packages()[1:5, c("Version", "Archs", "Built")]
 Version   Archs   Built
  affxparser "1.22.0"  "affxparser.so" "2.12.0"
  affy   "1.28.0"  "affy.so"   "2.12.0"
  affydata   "1.11.10" NA  "2.12.0"
  affyILM"1.2.0"   "affyILM.so""2.12.0"
  affyio "1.18.0"  "affyio.so" "2.12.0"

Also the man page for installed.packages would need to be updated to
list this new Archs column (Value section).

Thanks,
H.


On 11/10/2010 01:13 PM, Hervé Pagès wrote:

Hi,

Today we've seen the following problem with the R-2.12 that we use
for our Windows builds:

 > installed.packages()
Error: subscript out of bounds

After some investigation we discovered that the cause of this failure
was that 1 of the 890 packages currently installed on the machine
(Windows Server 2003 R2) had its DESCRIPTION file empty:

E:\biocbld\bbs-2.7-bioc\R\library>ls -al DLBCL
total 1
drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 .
drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-10 00:14 ..
-rwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 DESCRIPTION
-rwxr-xr-x+ 1 biocbuild2 root 357 2010-11-08 14:11 INDEX
drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 data
drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 help
drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 html

Then from R:

 > library(DLBCL)
Error in library(DLBCL) : there is no package called 'DLBCL'
 > packageDescription("DLBCL")
Error in packageDescription("DLBCL") :
DESCRIPTION file of package 'DLBCL' is corrupt
 > installed.packages()
Error: subscript out of bounds

I have no idea how this DESCRIPTION file ended up empty. I've never
seen this before. Probably a very rare race condition that would be
very hard to reproduce.

Anyway would it be possible to have installed.packages() give
a more informative error message when this happens? That would
make it behave more consistently with packageDescription().

Does something like this sound reasonable?

hpa...@latitude:~/svn/R-trunk$ svn diff src/library/utils/R/packages.R
Index: src/library/utils/R/packages.R
===
--- src/library/utils/R/packages.R (revision 53546)
+++ src/library/utils/R/packages.R (working copy)
@@ -453,6 +453,11 @@
domain = NA, call. = FALSE)
next
}
+ if (NROW(desc) < 1L) {
+ warning(gettextf("file '%s' is corrupt", pkgpath),
+ domain = NA, call. = FALSE)
+ next
+ }
desc <- desc[1,]
Rver <- strsplit(strsplit(desc["Built"], ";")[[1L]][1L],
"[ \t]+")[[1L]][2L]

Thanks,

H.




--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

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


[Rd] installing dependencies: binary vs source

2010-11-11 Thread Hervé Pagès

Hi,

Installing from binaries on Windows:

  > install.packages("multtest")
  Warning: dependency 'Biobase' is not available
  trying URL 
'http://cran.fhcrc.org/bin/windows/contrib/2.12/multtest_2.6.0.zip'

  Content type 'application/zip' length 1645590 bytes (1.6 Mb)
  opened URL
  downloaded 1.6 Mb

  package 'multtest' successfully unpacked and MD5 sums checked

  The downloaded packages are in

C:\Users\biocbuild2\AppData\Local\Temp\2\RtmpPzRqzb\downloaded_packages

Note the warning that a dependency is missing. But still the package
got installed even though it won't be loadable.

Now installing from source on Windows:

  > install.packages("multtest", type="source")
  Warning: dependency 'Biobase' is not available
  trying URL 'http://cran.fhcrc.org/src/contrib/multtest_2.6.0.tar.gz'
  Content type 'application/x-gzip' length 1457444 bytes (1.4 Mb)
  opened URL
  downloaded 1.4 Mb

  ERROR: dependency 'Biobase' is not available for package 'multtest'
  * removing 'D:/biocbld/bbs-2.7-bioc/R/library/multtest'

  The downloaded packages are in

'C:\Users\biocbuild2\AppData\Local\Temp\2\RtmpPzRqzb\downloaded_packages'
  Warning message:
  In install.packages("multtest", type = "source") :
installation of package 'multtest' had non-zero exit status

Note the warning *and* ERROR.

Is this the intended behavior of install.packages() when installing
from binaries?

Thanks,
H.

PS: Sorry I don't have access to an R-2.13 installation where I can
test this at the moment.

  > sessionInfo()
  R version 2.12.0 (2010-10-15)
  Platform: x86_64-pc-mingw32/x64 (64-bit)

  locale:
  [1] LC_COLLATE=English_United States.1252
  [2] LC_CTYPE=English_United States.1252
  [3] LC_MONETARY=English_United States.1252
  [4] LC_NUMERIC=C
  [5] LC_TIME=English_United States.1252

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


--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

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


Re: [Rd] Problem with system2(), directing STDERR to a file

2010-11-11 Thread Dan Tenenbaum
I notice that a fix for this issue was checked in. Thanks, much appreciated!

But it still seems broken on Windows. Given the same ruby script, and this R
code:

> cmd <- "c:/ruby192/bin/ruby"
> args <- c("test.rb")
> t <- tempfile()
> system2(cmd, args, stdout=TRUE, stderr=t)
[1] "stderr" "stdout"
> file.exists(t)
[1] FALSE

I would expect only "stdout" to show up in the console, and t to contain
"stderr".

> sessionInfo()
R version 2.13.0 Under development (unstable) (2010-11-04 r53530)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

loaded via a namespace (and not attached):
[1] tools_2.13.0

Thanks
Dan


On Wed, Nov 10, 2010 at 9:11 PM, Dan Tenenbaum  wrote:

> Hi Keith,
>
> The problem is not with tempfile(), and is not really a problem of whether
> a file exists or not. The problem is that system2() does not put the
> contents of stderr into the file. Here is a demonstration without the use of
> tempfile(), using a pre-existing output file:
>
> klediment:~ dante$ echo "Hello" > output.txt
> klediment:~ dante$ cat output.txt
> Hello
> klediment:~ dante$ R -q
> > system2("./test.rb", stderr="output.txt")
> stderrstdout> q("no") # should only see "stdout" in console, "stderr"
> should go to file
> klediment:~ dante$ cat output.txt
> Hello
> klediment:~ dante$ R -q
> > system2("./test.rb", stdout="output.txt") # works correctly
> stderr> q("no")
> klediment:~ dante$ cat output.txt
> stdoutklediment:~ dante$
>
> My sessionInfo() follows, but I got the identical behavior on R 2.12
> (release version) and R 2.13.
>
> Thanks,
> Dan
>
>
> > sessionInfo()
> R version 2.12.0 Patched (2010-10-15 r53335)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
>
>
> On Wed, Nov 10, 2010 at 7:33 PM, Keith Satterley wrote:
>
>> Looking at help for tempfile,
>>
>> "tempfile" returns a vector of character strings which can be used as
>> names for temporary files.
>>
>> and
>>
>> For "tempfile" a character vector giving the names of possible
>>(temporary) files. Note that no files are generated by "tempfile".
>>
>>
>> try a file.create(t) after tempfile()
>>
>> cheers,
>>
>> Keith
>>
>>
>> Dan Tenenbaum wrote:
>>
>>> According to ?system2, I should be able to direct the output of STDERR to
>>> a
>>> file by giving the filename as a character vector to the "stderr"
>>> argument.
>>>
>>> But here is what happens.
>>>
>>> Given a ruby script test.rb (with its executable bit set):
>>>
>>> #!/usr/bin/env ruby
>>> STDOUT.puts "stdout"
>>> STDERR.puts "stderr"
>>>
>>> And the following R code:
>>>
>>>
>>>
 t <- tempfile()
 res <- system2("./test.rb", stdout=TRUE, stderr=t)


>>> stderr
>>>
>>>
 res


>>> [1] "stdout"
>>>
>>>
 file.exists(t)


>>> [1] FALSE
>>>
>>> I would expect the file t to exist and contain "stderr", and I would
>>> expect
>>> not to see "stderr" in the console.
>>>
>>> Also, there is a typo in the man page - the command is listed as "system"
>>> in
>>> the Description instead of "system2".
>>>
>>> The reverse behavior does work correctly:
>>>
>>>
 res <- system2("./test.rb", stdout=t, stderr="")


>>> stderr
>>>
>>>
 file.exists(t)


>>> [1] TRUE
>>>
>>>
>>> Thanks!
>>> Dan
>>>
>>>[[alternative HTML version deleted]]
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>>
>>
>> __
>> The information in this email is confidential and intended solely for the
>> addressee.
>> You must not disclose, forward, print or use it without the permission of
>> the sender.
>> __
>>
>>
>

[[alternative HTML version deleted]]

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