s-news
[Top] [All Lists]

Re: replacing values in a data frame

To: "Khan, Sohail" <khan@cshl.edu>, <s-news@lists.biostat.wustl.edu>
Subject: Re: replacing values in a data frame
From: "Petr Pikal" <petr.pikal@precheza.cz>
Date: Tue, 22 Aug 2006 09:40:58 +0200
In-reply-to: <C8696843AE995F4EA4CDC3E2B83482A9018790BD@mailbox02.cshl.edu>
Hi

data.frame[data.frame<20] <- NA

works In R so maybe it work in S+ too.

HTH
Petr


On 21 Aug 2006 at 16:22, Khan, Sohail wrote:

Subject:                [S] replacing values in a data frame
Date sent:              Mon, 21 Aug 2006 16:22:36 -0400
From:                   "Khan, Sohail" <khan@cshl.edu>
To:                     <s-news@lists.biostat.wustl.edu>

> Dear list,
> 
> I have a large data frame with several numerical columns, I would like
> to replace all the values < 20 to NAs. How could I do this?  Thanks
> for your suggestions.
> 
> Sohail 
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news

Petr Pikal
petr.pikal@precheza.cz


<Prev in Thread] Current Thread [Next in Thread>