[R] mathematical notation in R

Philipp Pagel p.pagel at wzw.tum.de
Thu Jul 23 09:45:24 CEST 2009


On Wed, Jul 22, 2009 at 08:00:24PM -0700, Mary A. Marion wrote:
> 
> I have an R function which includes the statement LBAuo<- -9999.
> Rather than printing out -9999 I want it to print out - infinity.

I'm not sure I understand what exactly you want. Do you want to
replace all values smaller than -9999 by -Inf? In that case try
something like this:

> x <- c(1,-9999, -8888, -100000, 12)
> x[x <= -9999] <- -Inf
> x
[1]     1  -Inf -8888  -Inf    12


cu
	Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/




More information about the R-help mailing list