[S]

Hatzikonstantinou Giannis (jhatziko@math.auth.gr)
Sat, 25 Apr 1998 04:54:59 +0300


On Wed, 22 Apr 1998, Hatzikonstantinou Giannis wrote:
> I have a vector x and i want to replace all the entries with value98,99,
> to missing values: However replace(x,c(98,99),NA)
> replaces the values x[98], x[99]. What should I do? I work with S+3.3
> win95

The solutions were:
1st:
x[x==98|x==99]<-NA

2nd
x<-replace(x,!is.na(match(x,c(98,99),NA)))

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news