[R] pmin behavior change in 2.0.0

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Nov 5 16:59:03 CET 2004


This is fixed in 2.0.1 beta that is currently available for testing.  It
was a bug in pmin that went undetected until things were tightened up.
[More precisely, pmin used an undefined construction, NA subscripts on the 
LHS of an assignment, that was not implemented consistently.]

Interestingly it came up on Monday, but in none of the testing of 2.0.0
nor for the first 4 weeks it was out.

On Fri, 5 Nov 2004, Brian Bielinski wrote:

> Hi,
> 
> In 2.0.0 the behavior of pmin has changed.
> It stops now with an error if all the elements
> at a particular point are NA.
> 
> These examples were run on windows xp, but the behavior
> for 2.0.0 is the same on linux.
> 
> R 1.9.1
> 
> >  pmin(c(1,NA,3),c(1,NA,2))
> [1]  1 NA  2
> >  pmin(c(1,NA,3),c(1,2,2))
> [1]  1 NA  2
> >  pmin(c(1,NA,3),c(1,NA,2),na.rm=TRUE)
> [1]  1 NA  2
> > 
> 
> 
> R 2.0.0
> 
> > pmin(c(1,NA,3),c(1,NA,2))
> Error: NAs are not allowed in subscripted assignments
> > pmin(c(1,NA,3),c(1,2,2))
> [1]  1 NA  2 
> > pmin(c(1,NA,3),c(1,NA,2),na.rm=TRUE)
> Error: NAs are not allowed in subscripted assignments
> >
> 
> Is this intentional?
> 
> Regards,
> 
> Brian
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
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, UK                Fax:  +44 1865 272595




More information about the R-help mailing list