Message-ID: <644e1f321001301607v48555dbfi6323e8b8a82cd62d@mail.gmail.com>
Date: 2010-01-31T00:07:19Z
From: jim holtman
Subject: Applying a transformation to multiple data frame columns
In-Reply-To: <1264883681036-1457641.post@n4.nabble.com>
for (i in c('aum', 'num','aum.core','num.core')) t[[i]][is.na(t[[i]])] <- 0
On Sat, Jan 30, 2010 at 3:34 PM, Dimitri Shvorob
<dimitri.shvorob at gmail.com> wrote:
>
> How can one simplify the folowing?
>
> t$aum[is.na(t$aum)] = 0; t$aum.core[is.na(t$aum.core)] = 0
> t$num[is.na(t$num)] = 0; t$num.core[is.na(t$num.core)] = 0
>
> Thank you.
> --
> View this message in context: http://n4.nabble.com/Applying-a-transformation-to-multiple-data-frame-columns-tp1457641p1457641.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?