[Rd] ifelse behaviour

2007-04-26 Thread ml-it-r-devel
Hi! I'm puzzled by the return value of ifelse consider x<-integer(0) ifelse(is(x, "character"), paste(x), x) [1] NA whereas if (is(x, "character")) return(paste(x)) else x [1] integer(0) or x<-integer(1) ifelse(is(x, "character"), paste(x), x) [1] 0 work as I had anticipated. Is this correct

Re: [Rd] ifelse behaviour

2007-04-26 Thread Duncan Murdoch
On 4/26/2007 9:53 AM, [EMAIL PROTECTED] wrote: > Hi! > > I'm puzzled by the return value of ifelse > > consider > > x<-integer(0) > ifelse(is(x, "character"), paste(x), x) > [1] NA The test evaluates to a length 1 logical vector containing FALSE. So ifelse() tries to return the first entry of

Re: [Rd] ifelse behaviour

2007-04-26 Thread Tony Plate
A simpler version of your "puzzling call to ifelse" is ifelse(FALSE, character(0), integer(0)) The most obvious way to satisfy the requirements stated in the documentation is to extend integer(0) to length 1 by creating an NA value, and that's what you get as a return value (here the 'test' ar

Re: [Rd] ifelse behaviour

2007-04-26 Thread ml-it-r-devel
Duncan Murdoch wrote: > On 4/26/2007 9:53 AM, [EMAIL PROTECTED] wrote: >> Hi! >> >> I'm puzzled by the return value of ifelse >> >> consider >> >> x<-integer(0) >> ifelse(is(x, "character"), paste(x), x) >> [1] NA > > The test evaluates to a length 1 logical vector containing FALSE. So > ifelse(

[Rd] path autocompletion in 2.5.0

2007-04-26 Thread Ernest Turro
Hi, R 2.5.0 isn't auto-completing paths properly as it used to. E.g. suppose I have: > dir("CEL/choe") [1] "chipC-rep1.CEL" "chipC-rep2.CEL" "chipC-rep3.CEL" "chipS-rep1.CEL" [5] "chipS-rep2.CEL" "chipS-rep3.CEL" Now if I do: ReadAffy("CEL/choe/ch # => ReadAffy("CEL/choe/chip ReadAffy("CEL/c

Re: [Rd] path autocompletion in 2.5.0

2007-04-26 Thread Prof Brian Ripley
Did you actually look at the NEWS file? o The Unix-alike readline terminal interface now does command-completion for R objects, incorporating the functionality formerly in package 'rcompletion' by Deepayan Sarkar. This can be disabled by setting the environment

Re: [Rd] path autocompletion in 2.5.0

2007-04-26 Thread Hin-Tak Leung
Read release note of 2.5.0. It is mentioned there. Ernest Turro wrote: > Hi, > > R 2.5.0 isn't auto-completing paths properly as it used to. E.g. > suppose I have: > > > dir("CEL/choe") > [1] "chipC-rep1.CEL" "chipC-rep2.CEL" "chipC-rep3.CEL" "chipS-rep1.CEL" > [5] "chipS-rep2.CEL" "chipS-rep

Re: [Rd] path autocompletion in 2.5.0

2007-04-26 Thread Ernest Turro
Apologies for missing that in NEWS. Apart for auto-completion breaking for paths with '-', this sounds very convenient. E On 26 Apr 2007, at 17:30, Prof Brian Ripley wrote: > Did you actually look at the NEWS file? > > o The Unix-alike readline terminal interface now does > command

[Rd] Problem with R-2.5.0 patched and Matrix package

2007-04-26 Thread Seth Falcon
Hi, Using latest R 2.5.0 Patched, I'm unable to install the Matrix package from cran.fhcrc.org. I get: Creating a new generic function for "isSymmetric" in "Matrix" Creating a new generic function for "unname" in "Matrix" Error in conformMethod(signature, mnames, fnames, f) : In method f

Re: [Rd] Signature of '!' (was Problem with R-2.5.0 patched and Matrix package)

2007-04-26 Thread Prof Brian Ripley
Yes, it works in the release. The essence of the problem is that Matrix defines an S4 method for '!' with dispatch on 'e1', but the documentation for '!' (and many S3 methods) says the argument is 'x'. As '!' is a primitive the argument matching of the base function might be expected to be pos

[Rd] evaluation in unattached namespace

2007-04-26 Thread Deepayan Sarkar
Hi, I recently discovered this buglet in lattice: If lattice is _not_ attached, I get > lattice::dotplot(~1:10) Error in eval(expr, envir, enclos) : could not find function "bwplot" This happens because of this: > lattice:::dotplot.formula function (x, data = NULL, panel = "panel.dotplot", ...)

Re: [Rd] evaluation in unattached namespace

2007-04-26 Thread Duncan Murdoch
On 4/26/2007 7:39 PM, Deepayan Sarkar wrote: > Hi, > > I recently discovered this buglet in lattice: If lattice is _not_ > attached, I get > >> lattice::dotplot(~1:10) > Error in eval(expr, envir, enclos) : could not find function "bwplot" > > This happens because of this: > >> lattice:::dotplo

Re: [Rd] evaluation in unattached namespace

2007-04-26 Thread Deepayan Sarkar
On 4/26/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 4/26/2007 7:39 PM, Deepayan Sarkar wrote: > > Hi, > > > > I recently discovered this buglet in lattice: If lattice is _not_ > > attached, I get > > > >> lattice::dotplot(~1:10) > > Error in eval(expr, envir, enclos) : could not find functio

Re: [Rd] evaluation in unattached namespace

2007-04-26 Thread Seth Falcon
Duncan Murdoch <[EMAIL PROTECTED]> writes: > On 4/26/2007 7:39 PM, Deepayan Sarkar wrote: >> Hi, >> >> I recently discovered this buglet in lattice: If lattice is _not_ >> attached, I get >> >>> lattice::dotplot(~1:10) >> Error in eval(expr, envir, enclos) : could not find function "bwplot" >>