[R] Omit Inf

Nordlund, Dan (DSHS/RDA)
Thu, 15 Dec 2011 00:27:24 -0000

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of William Dunlap
> Sent: Wednesday, December 14, 2011 4:19 PM
> To: Trying To learn again; r-help at r-project.org
> Subject: Re: [R] Omit Inf
>
> > range(a, finite=TRUE)[2]  # [1] for the min
> [1] 2
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
> > -----Original Message-----
> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Trying To learn
> > again
> > Sent: Wednesday, December 14, 2011 3:55 PM
> > To: r-help at r-project.org
> > Subject: [R] Omit Inf
> >
> > Hi all
> >
> > > a<-c(2,Inf)
> > > max(a)
> > [1] Inf
> > >
> >
> > How can I say...omit Inf?
> >
> > I cannot find anything...
> >

You could use something like

max(a[is.finite(a)])


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204